No announcement yet.

Polling Frequency ?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Polling Frequency ?

    Hi All,
    Will Mirth accept 604800000 as an interval value in the polling Frequency (ms).?? That value is equal to 7 days.

    Also can Mirth accept a monthly value in the polling Frequency (ms).?

    If so, what would the value be?



  • #2
    1. Yes, Mirth will accept a polling frequency of 7 days in milliseconds.

    2. Yes, technically Mirth can accept a 1 month polling frequency in milliseconds. Good look figuring out how to do it though, as the months change from 30 to 31 days per month and the frequency would need to change as well.

    Side note: If you try and set a channel to poll for 1 week, or 1 month, or whatever, be advised that if the server goes down and back up, the Mirth service is restarted, or something else happens, that as soon as the Mirth service starts back up, the channel will poll at that time the server came back up and the whole schedule will be screwed.

    i.e. You have a channel set to poll every 7 days and deploy it on Friday at 7pm. If the server goes down on Monday at 3am and comes right back up at 3:10am, then the channel will start polling every 7 days starting at 3:10am on Monday.

    You could set the channel to no automatically start/be enabled, which would prevent it from polling again once the server came back up, but you would have to then wait until the correct day/time to redeploy and start the channel again to get the polling in sync.

    IMO, one of the biggest drawbacks in Mirth is the channel scheduling. It's really a pain.


    • #3
      Very nice...Thank you!!!


      • #4
        Also, if set it to poll every 7 days (in Milliseconds) and you start at Monday @ Midnight, if it takes 10 minutes to run, it will kick off next friday at 12:10 AM.


        • #5
          The polling frequency is currently stored as a signed 32-bit integer, so the maximum value is 2147483648 ms, or about 25 days. So unfortunately that's outside the range of a month. But when you want to schedule something with that large of an interval, you're typically better off using a smaller interval, and a filter or something to only allow messages during a specific time/day of the week/month.

          FYI feel free to comment/vote on MIRTH-841. It's definitely an area we're looking to improve on in a future version.
          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.


          • #6
            Thanks Nick!!


            • #7
              I did a trick like that using joda time API

              // only send this email on th 2d of month
              var day = new;
              return day == 2;
              Simple and functionnal.
              In your polling interval, just put 1 day, so that you could cope with a server restart as said before.

              I use many filters like this.
              Another example is to run a task every day but the week end.

              var day = new;
              return (day != && day !=;
              or simply

              var day = new;
              return day <= 5
              but i prefer the fisrt solution, which is more readeable.