web stats
Polling Frequency ? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 04-27-2015, 09:58 AM
Rubicon Rubicon is offline
OBX.2 Kenobi
 
Join Date: Feb 2013
Posts: 98
Rubicon is on a distinguished road
Default 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?

Thanks!!

Rubi
Reply With Quote
  #2  
Old 04-27-2015, 10:16 AM
upstart33 upstart33 is offline
Mirth Guru
 
Join Date: Dec 2010
Location: Chicago, IL.
Posts: 461
upstart33 is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 04-27-2015, 10:17 AM
Rubicon Rubicon is offline
OBX.2 Kenobi
 
Join Date: Feb 2013
Posts: 98
Rubicon is on a distinguished road
Default

Very nice...Thank you!!!
Reply With Quote
  #4  
Old 04-27-2015, 10:23 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,348
cory_cole is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 04-27-2015, 10:44 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

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.
Reply With Quote
  #6  
Old 04-27-2015, 10:45 AM
Rubicon Rubicon is offline
OBX.2 Kenobi
 
Join Date: Feb 2013
Posts: 98
Rubicon is on a distinguished road
Default

Thanks Nick!!
Reply With Quote
  #7  
Old 04-27-2015, 11:00 AM
lionelroux lionelroux is offline
OBX.2 Kenobi
 
Join Date: Apr 2013
Posts: 82
lionelroux is on a distinguished road
Default

I did a trick like that using joda time API

Code:
// only send this email on th 2d of month
var day = new Packages.org.joda.time.DateTime().dayOfMonth().get();
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.

Code:
var day = new Packages.org.joda.time.DateTime().dayOfWeek().get();
return (day != Packages.org.joda.time.DateTimeConstants.SUNDAY && day != Packages.org.joda.time.DateTimeConstants.SATURDAY);
or simply

Code:
var day = new Packages.org.joda.time.DateTime().dayOfWeek().get();
return day <= 5
but i prefer the fisrt solution, which is more readeable.
Reply With Quote
Reply

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 09:03 PM.


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