web stats
Http sender problem - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2018, 02:17 AM
Tom123 Tom123 is offline
Mirth Newb
 
Join Date: Feb 2016
Posts: 8
Tom123 is on a distinguished road
Default Http sender problem

I use Mirth 3.2.2.7694

Listener 1, fetches planning data from database using web service
- sends xml data to PlanningChannel which handles planning xml message and saves xml-message file to local disk
- connector type: file writer
- queue messages: never
- template: ${XmlUtil.prettyPrint(${XML})}


Listener 2, fetches realization data from database using web service
- sends xml data to RealizationChannel which sends xml-data forward to another system
- connector type: http sender
- queue messages: always
- Retry interval: 10000 ms
- Rotate queue: no
- Regenerate template: yes
- Include filter/transformer: yes
- Queue threads: 1
- Content: ${XmlUtil.prettyPrint(${message.encodedData})}


There is sometimes this kind of error in channels

- Listener 1 fetches planning data and sends it to PlanningChannel. Sent Message is okay.

- Listener 2 fetches realization data and sends it to RealizationChannel
In Mirth: Raw data, endoced data is realization data, but Sent data is the same message which
is in PlanningChannel Sent data ??
So Sent data is not realization data (xml), but it is xml-message from PlanningChannel/Sent.
I don't understand this ?
How it is possible, that


There is no filter and no transformer code, so raw message, encoded message and sent message are similar in RealizationChannel.
But sometimes Sent message in RealizationChannel is message from PlanningChannel Sent message.



There are some timestamps of channels when I noticed this kind of problem.
Timestamps are almost the same.


PlanningChannel
connector: send planning data: status: SENT, ReceivedDate: 2018-04-04 09:23:22:727, ResponseDate: 2018-04-04 09:23.22.750

RealizationChannel
connector: send realization data: status: SENT, ReceivedDate: 2018-04-04 09:23:22:630, ResponseDate: 2018-04-04 09:23.22.897


How could I solve this problem ?

Last edited by Tom123; 04-04-2018 at 09:38 PM. Reason: More information
Reply With Quote
  #2  
Old 04-05-2018, 06:02 AM
JohnHD JohnHD is offline
Mirth Newb
 
Join Date: Sep 2013
Location: Costa Mesa, CA
Posts: 21
JohnHD is on a distinguished road
Default

Sorry to start with this, but have you tried clearing your java cache? This sounds like a client side (viewing) issue?
__________________
Ask The Experts! Free 15 minute live Q&A sessions with one of Zen's Expert Integrators @ https://consultzen.com/integration-service-desk-solutions

www.consultzen.com
Reply With Quote
  #3  
Old 04-05-2018, 11:22 PM
Tom123 Tom123 is offline
Mirth Newb
 
Join Date: Feb 2016
Posts: 8
Tom123 is on a distinguished road
Default

- Mirth is on customer's production server (windows server 2012 R2)

- Do you think that Mirth "Sent" message view shows wrong data in channel Realization and
right realization data message has been sent to another systeme with http sender ?

I don't think so, because receiving system has reported errors that it sometimes receives planning data from Mirth
instead of realization data. So I think that Mirth "Sent" message view is right.


- I haven't cleared cache and I am not admin user on customer's server and they are some other users too which sometimes open Mirth Connect dashboard.

I think I can find on Google, how can I do it.
But if you could help with this, I would appreciate it.
Can I clear cache if Mirth is started and is handling messages ?
I found configure java and there is folder name where cache is...users etc.
But I can't find this folder.

Last edited by Tom123; 04-06-2018 at 05:10 AM.
Reply With Quote
  #4  
Old 04-06-2018, 06:14 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 749
agermano is on a distinguished road
Default

Do your channels use globalMap variables?

When you say listener 1 sends to Planner Channel, are you referring to the source and destination connectors of the same channel or is it actually two different channels?
Reply With Quote
  #5  
Old 04-08-2018, 07:01 AM
Tom123 Tom123 is offline
Mirth Newb
 
Join Date: Feb 2016
Posts: 8
Tom123 is on a distinguished road
Default

- I don't use globalMap variables

- Listener 1, PlanningChannel and
Listener 2, RealizationChannel
are not referring to each other

Listener 1:
- polling frequency 60000 ms
- maybe fetch none, one or a lot of planning messages at the same time
- uses router.routeMessage(channel,single) to send message one by one to PlanningChannel

PlanningChannel:
- summary: message storage: development

- use filter
- destination transformer:
inbound message template and outbound message template
build Planning xml-message
- for example tmp['Field1']['Id1'] = msg['Field2']['Id2'].toString() etc..--
- var xml = tmp.toXMLString ();
- connectorMap.put('XML', xml);

- write messages to local disk file, never use queue
- use template ${XmlUtil.prettyPrint(${XML})}



Listener 2:
- polling frequency 60000 ms
- maybe fetch none, one or a lot of realization messages at the same time
- uses router.routeMessage(channel,single) to send message one by one to RealizationChannel

RealizationChannel:
- summary: message storage: development

- not filter

- destination transformer:
inbound message template
not build new Realization xml-message, so raw message is the same like encoded, transformed, sent message

- http sender to another system, using queue
- Content: ${XmlUtil.prettyPrint(${message.encodedData})}

At this week (14/2018)

- PlanningChannel write 2263 messages to local disk files. All of them were okay
- RealizationChannel sent 7489 messages to another system (http sender), one of them was wrong Planning message
and receiving system reported wrong type of xml-message.
'Raw', 'transformed' and 'encoded' message was realization message, but 'Sent' message was planning message and I found the same message
in PlanningChannel (see timestamps which I wrote earlier)



- MirthDb is in sql server 2014 database
- Server settings: Channel:
Clear global map on redebloy: Yes
Queue buffer size: 1000
Default metadata columns: selected: source and type

Mirth.properties:
administrator.maxheapsize = 512m

- Planning and Realization Channel:
Prune messages older than 10 days
So both channels saves thousands of messages to MirthDB

- Data Pruner is running every night.

Last edited by Tom123; 04-09-2018 at 04:59 AM.
Reply With Quote
  #6  
Old 04-09-2018, 09:25 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 749
agermano is on a distinguished road
Default

Only thing I can think of is that maybe XMLUtil.prettyPrint is not threadsafe. That looks like the only thing that's happening that could possibly send the wrong encodedData.
Reply With Quote
  #7  
Old 04-09-2018, 09:29 PM
Tom123 Tom123 is offline
Mirth Newb
 
Join Date: Feb 2016
Posts: 8
Tom123 is on a distinguished road
Default

RealizationChannel sends thousands messages with http sender / week
and there can be only few wrong 'sent' messages (last week only 1) which are from another channel

Http sender use POST-method.

Does someone know about ${XmlUtil.prettyPrint(${message.encodedData})}
and queue ?

Is it possible that queue buffer size is too small ?
It is now 1000 in server settings.

I have two other channels which use always queue.
There are queue threads 1 in all these channels.

Last edited by Tom123; 04-09-2018 at 11:40 PM.
Reply With Quote
  #8  
Old 04-10-2018, 08:10 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 749
agermano is on a distinguished road
Default

I don't believe it is because of the queue. Those are stored in separate database tables and read by different process threads. The only way I can see one channel outputting the results of a different channel is if the two threads share memory at some point.

I suspected it might be the pretty printer because that is a static function that both threads are calling at roughly the same time, and it appears to be returning the wrong result to one of the calls from what you have described.
Reply With Quote
  #9  
Old 04-17-2018, 10:05 PM
Tom123 Tom123 is offline
Mirth Newb
 
Join Date: Feb 2016
Posts: 8
Tom123 is on a distinguished road
Default

Hi !

Thanks.

I changed http sender content field:

${XmlUtil.prettyPrint(${message.encodedData})}

->

${message.encodedData}

Now it seems that http sender sends always right endoced data to another system.
Reply With Quote
Reply

Tags
http sender

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:10 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation