How to setup BPM Suite Timers to work in Websphere Application Server clustering
Environment
-
Red Hat JBoss BPM Suite
- 6.x
-
IBM WebSphere Application Server
- 8.5.x
Issue
- I don't see any documentation on quartz/ejb timer in
WebSphereinstallation. I wanted to check what is suggested version for timers and is there any specific configuration that needs to be done onWebSpherefor implementingejb timer.
Resolution
BPM Suite processes will not work properly with IBM WebSphere Application Server (WAS) for Timers due to Quartz limitations. Instead BPM Suite will use EJBTimers when deployed on top of WAS. No addition setup is required, the engine identifies that it is in a WAS deployment and use EJBTimers out-of-box.
More information about how EJBTimers and Quartz works with IBM WebSphere Application Server is as follow.
-
When Quartz executing jobs (timers of the process), it will process it in non managed thread and thus WAS would not allow to access JNDI in turn to transaction.
-
Quartz needs non transactional data source as it will use locks on jobs so it will directly call commit on connection which is not allowed on transaction data source.
-
WAS does execute timers on single node in the cluster any way and it implies that, for Webpshere cluster, the
BPM Suiteworks out of box and hence no need to set a persistent EJBTimer explicitly. The reason is WAS comes with default derby data source (which is file based db) and it can be changed if required. Please refer IBM docs[1] to change the data source if needed. -
IBM WebSphereoffers unique challenges when it comes to using transaction management, thread pools, and timers in an application container. The Executor inJBPM 6allows you to call tasks/services asynchronously while properly using the thread pools using the WAS Worker Manager, and integrating with transaction management. This service layer allows you plug into the EJB Timer service provided by WebSphere using the timers, clustering, and failover capabilities that come with it. -
Regarding how to use EJB Timer service - refer this test case [1] in jBPM, that enlightens how to use it in an application. The
EjbSchedulerServiceusesjavax.ejb.TimerService, that is managed by the EJB container. Possible settings of EJB Timer service on WebSphere are covered in this article [2].
Few thread pooling and tuning tips for EJB Timer, Executor, and Worker Manager
- It is ideal to use a single executor and ejb timer thread as they are delegate-ors not workers
- Having multiple timer or executor threads makes the workload unstable instead of a smooth push for work
- More throughput can be achieved by lessening the poll interval of the timer or executor instead of increasing the thread count
- WebSphere EJB timers provide a singleton EJB timer coordinator where only a single node in the cluster spawns threads
- Quartz requires specific configuration to attach to WAS Worker Manager, which is bespoke to WAS
- EJBTimers will make best use of WAS Worker threads
- EJB Timers are good for JBoss EAP and WAS and should be considered the most scalable
Links Referred
[1] Content from www-01.ibm.com is not included.Content from www-01.ibm.com is not included.https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/uejb_timerservice.html
[2] Content from github.com is not included.Content from github.com is not included.https://github.com/droolsjbpm/jbpm/blob/master/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/test/java/org/jbpm/services/ejb/timer/test/EjbTimerServiceIntegrationTest.java#L129
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.