Announcement

Collapse
No announcement yet.

Http sender problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 09:38 PM. Reason: More information

  • #2
    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

    Comment


    • #3
      - 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, 05:10 AM.

      Comment


      • #4
        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?

        Comment


        • #5
          - 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, 04:59 AM.

          Comment


          • #6
            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.

            Comment


            • #7
              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, 11:40 PM.

              Comment


              • #8
                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.

                Comment


                • #9
                  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.

                  Comment

                  Working...
                  X