I am a Newbie to WMB and We have a requirement for Kicking Off a Msg Flow at 10 P.M each night.
After alot of Googling, I have suggested 2 ways to them -
1. Use a CronJob to put a msg on the Input Q to start the flow.
2. Use Timeout Notification node.
They have declined option 1 saying that IBM doesn't support cron jobs anymore, so we can't put that on the server.
For option 2, they are still fine but I have a question - Today i deploy the flow at the exact same time when I want it to et triggered after 24 Hrs but what happens when the Server is rebooted or the Flow is Stopped and started.
Will the timer also start again from that moment and If Yes is there any Workaround this problem of rebooting or restarting that can be followed, so the flow is kicked off on the exact same time at 10 P.M irrespective even if it was redeployed or something like that.
We also have TWS in our environment, But I could not find any Integration documents or scenarios of TWS integration with IIB, Could you kindly give your valuable advices or comments - How can I reach to an efficient solution.
Thanks
Sumit
Yes, the timer will start when the flow containing the Timeout Notification starts.
A workaround could be to construct a flow that starts with a Timeout Notification, and in a Compute node connected directly to the output of the Timeout Notification, you check the CURRENT_TIMESTAMP, and only continue executing the flow if it is around the right time. To make this work the Timeout Notification should have a timeout value set, that allows for the required precision of the instant.
Use timer control node to pass specify timer to trigger
And for that particular the timer notification node will receive message and kick starts
Related
I probably have found a similar question (and answer) but I wanted to know if any better alternative is available.
Link to similar question:
http://mqseries.net/phpBB/viewtopic.php?t=72601&sid=f62d9730d61ee2ee2a59986dd79defd1
I want to schedule a particular message flow every 5 seconds (or so). I'm using IIB 10 and it's not associated with MQ. So, Timer nodes are non functional.
I've read about scheduling it with cronjob but again it's getting dependent on the OS which is not my preference. Is there any alternative to the timeout notification node?
Can we use java.util.TimerTask or something similar to to it? Any helping hands please?
I don't know of any solution that does not require a cron job or other external scheduler.
Many organisations use a distributed scheduler like Ctrl-M for a wide range of tasks, and adding a couple of jobs to support the integration layer is not seen as a problem.
You can write you own timer flow using an infinite WHILE loop with SLEEP and PROPAGATE TO TERMINAL functions and sending HTTP requests or configure a "CallableFlow".
I need a better way to use my alerting code.Right now I have a code that check for space free on aws ecs and sends a simple notification to slack if space is less than 5gb using slack api.I used this code in jenkins and setup a periodic schedule to run every 15 min.But once the notification is triggered I wanted it to stop the check for 4 hours so, it won't fill the slack channel with messages .So, i used sleep 14400 after condition is triggered.But this leaves an executor of jenkins waiting.Is there a better way to do this?
If you really want a better way, you should use better tools. there are many tools (some free) out there, that can monitor something in a stateful manner (for example, using a daemon).
Writing to log (or slack channel) in this context of using Jenkins is sort of stateless, for example you cannot check whether an alarm is currently triggered or not.
Since you cannot check if an alarm is already triggered - using jenkins with the logic you requested in your question ('snooze feature') can be very ugly.
In general I would recommend using Conditional BuildStep to trigger a step if a condition is met (i.e. if alarm not already triggered), but since there is no way for you to poll this information, or achieve this with Jenkins without the solution being 'hackish' like creating a file to indicate alert is on, and deleting it from another job if it was created more than 4 hrs ago - I would suggest looking at tools more suitable for the job.
We use Spring Batch for some long running maintenance jobs. Very occasionally a job may get stuck on database/network hiccups. Is there a way email can be sent out upon those occasions, say, if any one step takes more than 2 hours to finish, a group of people will get an email alert?
To send the mail, you can use this class from Spring : org.springframework.mail.javamail.JavaMailSenderImpl
and to check your condition, you can just implement a loop inside a org.springframework.batch.core.StepListener.
This is if u want to receive a mail AFTER a step has finished and took more than 2 hours to finish.
To receive a mail while the step is still running, and has passed the 2 hours limit, it's harder and would require some multithreading development or some external job able to monitor your main job (through org.springframework.batch.core.explore.JobExplorer).
Thanks for the replies. We end up using some other monitoring tools systematically monitoring the batch job's performance and other systems' performances.
I am using Parse.com backend for my application and I need to perform a particular job at a specific time and notify the mobile app via Push notification.
I cannot find a way to do it from code. I see we can only schedule jobs in Parse using its UI.
A common solution is to have a job that runs every 5 minutes, checking for a record that's due to be processed and comparing the time to now. If it is due then do the work and send the notification, marking the job as done (or just deleting the record depending on your needs).
I'm creating a mechanism in my web server whereby a scheduled task will execute every 15 minutes and notify users if any activity has occurred within that time frame. It would work as follows:
Annotate a with #Scheduled and schedule to run every 15 minutes
When the task runs, scrape the database for any changes within 15 minutes of the current time
A couple problems I can see:
If I have to restart the server and it's down for longer than 15 minutes, I would need to look back longer than 15 minutes so that no activity is missed.
I m running a number of tomcat servers and only one of them needs to execute the task. Otherwise, duplicate emails will be sent to users.
Has anyone dealt with this before? I'm thinking that this should really be a task external to the web servers... that would solve the issue of duplicate emails being sent, but it wouldn't solve the server bounce issue.
Any ideas on how to solve would be greatly appreciated!
I would have done the following steps to perform the scheduling:
On Application startup query for tasks from database (only those which don't have a dirty flag set to false) and schedule it.
On each run of scheduled task put a dirty flag to suggest the task has run
Because I will be retrieving those tasks only which are marked as dirty, the issue of multiple emails should not occur even on server startup.