EJB Timer retry Interval - timer

Is it possible to increase the retry interval of EJB Timer in WAS ? When I m getting a database timeout error, the Timer was keep retrying after every 30 seconds which I dont want to be like that.

See the "Retries and missed timeouts" section of the Creating timers using the EJB timer service for enterprise beans topic in the knowledge center. Specifically:
First retry attempt is immediate. Subsequent retry attempts occur on
the configured scheduler poll interval for persistent timers, and on
the configured retry interval for non-persistent timers.
See the EJB timer service settings and Configuring a timer service topics in the knowledge center for more information on configuring the poll interval and other timer service settings.

Related

Schedule camel timer to run in 2servers at a time

I have a requirement where my application job must trigger every 10min which I configured using camel timer. Now the issue is this bundle is running in two different servers and both trigger same time as well.. is there a way to manage the timer in both servers so that it will not run at same time and do it periodically?
A very minimalist but often sufficient solution would be to use the delay option (for setting an initial delay before the first trigger) of Camel Timer.
Calculate a random initial delay on startup according to your period. In your case a random delay between 0 and 10 minutes and set it as delay.
However, with "bad luck" they can still start very close to each other.
It will be more effective to use Camel Quartz instead of Camel Timer on burki solution, the cron mask will be more effective.
For a robust solution, you should look at idempotency but it takes time to set up.

WebSphere EJB timers

We have an application that is currently migrated to WebSphere 8.5 from WebSphere 6. The application uses EJB annotations and EJB timers. The timers are set to execute every 5 minutes. This feature was working for years without any problems on WebSphere 6. After migrating to WebSphere 8.5 the EJB timers are indefinitely getting triggered every millisecond as supposed to trigger every 5 minutes(a predefined value). Can anybody please help me find the root cause for this problem.
If you are using the same database tables before and after the migration, such that pre-existing timer tasks remain scheduled, and there was a period of time during which they were unable to run, the behavior you describe could be due to catching up on missed executions.
If this is is the case, try querying the table (documented here) for the NEXTFIRETIME. If the number of milliseconds represented by this value is for a date in the past, then you can expect to be running missed executions. One option would be letting it run and allowing it to catch up to the current time. Otherwise, you could cancel and reschedule the timer tasks.

Multi-user timer with Google App Engine

We are implementing multi-user timer with Google App Engine. When the timer ends we need to do some calculations and send results to users. Several users should be able to start and pause the timer from different browsers. We will use Channels API for communication. How could we trigger the calculations at specific time?
One idea that we have is, when the timer starts, to create a push task with eta set to timer finish time. When that task runs, check for timer state which is stored in memcache or datastore, and create another task if the state was modified due to pausing the timer. If the timer is finished the task launches the calculations. Are there better approaches, since there is no guarantee that the task will run exactly at eta?
You could have a constantly repeating task (re-enqueing itself, eventually with a delay specified in seconds) which would check the timer state and perform the calculations if appropriate or just return if not.

jBPM6 not persisting boundary timers

I have a jBPM process setup with a boundary timer on a human task set for 30s (for testing purposes) - this is to escalate to another task if the time expires.
This normally functions correctly - when the task is reached and 30s are up, the flow is moved to the next task.
However, if I bounce the server, it seems that none of the timers are recreated and the flow sits on that task indefinitely.
The chances of the server being bounced in the real world are fairly high, as the timeouts will be more likely to last a couple of days.
Does anyone know if this is a known issue?
How are you executing your process, using the execution server as part of jbpm-console or embedding the engine yourself?
If you are embedding the engine yourself, note that you need to reinitialize your RuntimeManager upon restart (don't wait on the first request to do this, as this won't reactivate timers).

appengine dynamic backends how to increase idle time?

The dynamic backend goes down after 2-4 minutes of idle time. Is there a way to increase this idle time? Because in my app I need do some initialization which will take time, and the time interval between 2 requests may exceed 5-10 minutes. If the instance goes down I need to again do the initialization.
I can't use resident backends because I need programmatic (from normal - frontend) way to start/stop the instance which is not possible currently.
Thanks
Adhi
You could rely on tasks queue to keep the backend alive.
Using the target argument, you can target backend with Push Queues as explained in the documentation
Using the eta argument, you could fire N noop task every minute to make sure the backend stay alive for at least N minutes after each request.
Hope that helps.

Resources