Announcement

Collapse

NextGen (Mirth) Connect 3.11.0 Released!

NextGen (Mirth) Connect 3.11.0 is now available as an appliance update and on our GitHub page. This release contains improvements to licensing and the NCPDP data type. It also includes various security fixes, general bug fixes, and improvements to commercial extensions. See the release notes for the complete list of fixes and improvements.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

Send messages order

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

  • Send messages order

    In a channel 'Database Reader' -> 'LLP Sender' I use this query, in javascript source pannel, to select "messages to send" :
    SELECT IDLINK,OR_ERRORCNT,EVENT_CODE,to_char(SYSDATE,'yyy ymmddHH24miss') AS eventdate FROM THL_ORM where OR_STATUS='0' order by IDLINK

    I note that messages aren't sent in idlink order.
    Whith this query:
    SELECT IDLINK,OR_ERRORCNT,EVENT_CODE,to_char(SYSDATE,'yyy ymmddHH24miss') AS eventdate FROM THL_ORM where OR_STATUS='0' AND rownum < 2 order by IDLINK

    Messages are obviously sent ordered.


    Enviroment:
    Mirth 1.6
    Oracle 9.2
    Win XP

  • #2
    Re:Send messages order

    I am experiencing the same odd behaviour but with a Database Reader -> JMS Writer. My guess is that Mirth is taking the resultset from the Database Reader Source and threading transactions for each row of the resultset in such a way that does not guarantee correct order/sequence of events. Huge problem. I'm trying to figure out how to change the Mirth source code myself to fix this but it may be beyond my abilities.

    Comment


    • #3
      Re:Send messages order

      You are correct - it does use a different thread for each message from the database.

      We can add the option to turn this behavior on and off - no problem. Please add it as an issue in the jira: http://www.mirthproject.org/community/issues

      We will add the UI parameter to turn the threading off and on.
      Chris Lang

      Comment


      • #4
        Re:Send messages order

        I'm attaching the patched file that ALWAYS turns off threading:

        This file is only helpful if you are building Mirth from source (it will need to be in the org.mule package hierarchy to override their implementation).
        Chris Lang

        Comment


        • #5
          Re:Send messages order

          Here's the file. TransactedPollingMessageReceiver.java (6334 bytes)
          Chris Lang

          Comment


          • #6
            Re:Send messages order

            Way to go Chris!

            I rebuilt from source using your over-riding mule class, ran my test 6 times and every time everything was in correct sequence.

            Comment


            • #7
              Re:Send messages order

              I wait next release

              Comment


              • #8
                Re:Send messages order

                If you wanto to enable/disable this option, I've created this new patch. It uses the "enable transactional endpoints" to enable/disable threading, as the non-threading option is very slow.

                It adds this funcionality to the MLLP receiver too.
                patch_to_ensure_serial_in_mllp_and_jdbc.zip (2269 bytes)

                Comment


                • #9
                  Re:Send messages order

                  Hi Alberto,

                  This sounds like it would fix a similar problem that I have with message order.
                  Sorry not too conversant with java

                  How do you apply the patch?

                  Thanks
                  Robin

                  Environment
                  Windows XP
                  Mirth V1.7
                  SQL Server 2000

                  Comment


                  • #10
                    Re:Send messages order

                    To apply the patch you need to download the source code, use the patch command and compile it.

                    But I'm attching the mirth-sever.jar and the db connector jar files patched.


                    dbHack.zip (133120 bytes)

                    Comment


                    • #11
                      Re:Send messages order

                      Hi Alberto,

                      Thanks, I downloaded the zip file but it says it is not a valid archive file and shows no content. Guess it got corrupted on upload?

                      Could you kindly attach a new zip with those jar files.

                      Many thanks for your help

                      Robin

                      Comment


                      • #12
                        Re:Send messages order

                        I can open it with IZArc without problems ...

                        The file seems to be OK

                        Comment


                        • #13
                          Re:Send messages order

                          FIles made with an standar zip tool dbhack.zip (1137334 bytes)

                          Comment


                          • #14
                            Re:Send messages order

                            I added this option in the Database Reader. It will be in the next public release. The issue number is here:
                            http://www.mirthproject.org/communit...owse/MIRTH-735
                            Jacob Brauer
                            Director, Software Development
                            NextGen Healthcare

                            sigpic

                            Comment

                            Working...
                            X