Announcement

Collapse
No announcement yet.

Potential to lose message when stopping a channel

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

  • Potential to lose message when stopping a channel

    I have built a polling javascript reader channel which reads approx. 15000 messages into a java.util.ArrayList(). I have noticed that I am able to stop the channel before it has finished processing the content of the ArrayList and adding these messages to the queue effectively losing the messages.

    I have tried with and without a source connector queue and it does not appear to make any difference. I can stop the channel dead after I know that I have added the last message to the ArrayList, but before they have all processed in through the source.

    Has anyone any advice they can give me? I wouldn't have expected the channel to stop while it was still reading in messages from the ArrayList.

    I am using Mirth Connect 3.0.3.

    Simon

  • #2
    You can save the array to the globalMap and keep track of the index.

    Comment


    • #3
      That is a good suggestion, but the behaviour does seem inconsistent with other types of channel where you see a 'Stopping' status while it finished message processing. I wonder if any of the development team would like to comment?

      Comment


      • #4
        This reason is that you are using an array. It will finish the processing of the message that it is on.

        Comment


        • #5
          That is expected. Stopping a channel will allow a currently processing message to finish. So if you're in the middle of processing message 5000 of 15000 from your ArrayList then stopping the channel will still allow that message to finish. At that point the channel is fully stopped and any subsequent dispatches will be rejected.
          Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

          Nicholas Rupley
          Work: 949-237-6069
          Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


          - How do I foo?
          - You just bar.

          Comment


          • #6
            Thank you both for your responses,
            Simon

            Comment


            • #7
              Gotchas of Arraylist...

              So with that in mind,(keeping track of the ArrayList and its index in the gc map area):

              Where would the preferred place be in the channel itself to code for the "resume" on the process. PreProcess, or Source Transformer? Not exactly sure where it would go? Say for instance In the channel:
              -I copy the ArrayList to gc map
              -As each iteration of the ArrayList completes I update the gc map Index var
              -Once process completes empty the cachced copy in gc map

              I would think in this scenario, I would want to place the code in Preprocessor to repopulate the arraylist thats being resumed. Would also need specific logic in src xformer to handle the "resume" rather than starting at the top and over-riding the historic data.

              Is that a correct assumption?
              Engine: Mirth 2.2.2.6388
              JRE:1.7.0

              Comment

              Working...
              X