WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

How do we manage Asynchronous EJBS in Liberty?

  • 1.  How do we manage Asynchronous EJBS in Liberty?

    Posted 11/18/20 04:41 PM

    In Websphere Application server ,we configure work managers for asynchronous EJB calls. We are planning to migrate our Websphere Applications to Liberty. I understand asynchronous beans, CommonJ Timer, and work managers are no longer options in Liberty based on this article:

    https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/rwlp_mig_workmgr.html

    What options do we have for successful migration of asynchronous EJBs to Liberty?



    #Support
    #SupportMigration
    #WebSphereLiberty


  • 2.  RE: How do we manage Asynchronous EJBS in Liberty?
    Best Answer

    Posted 11/18/20 04:49 PM

    Liberty (and WebSphere traditional) both have ,

    then when your application calls it, the method will run asynchronously. If you really want to schedule an

    EJB method to run, then you would use an EJB timer via

    EJB ; optionally returning a future.

    Any management of that thread would need to be performed by the application, either in the asynchronous

    method, or by the caller through the returned Future.

    If you are looking for something similar to ComonJ Timer, then a lot of this depends on what sort of

    timeout you want. If you want the work to run after a certain amount of time, EJB Timers or

    ManagedScheduledExecutorService would be appropriate for that. However, if you want to submit the work

    to have it run right way if possible and otherwise have the work time out such that it gets canceled

    if it is too slow in starting, then the approach of using a ManagedExecutorService with a

    ManagedTaskListener that checks against the submit time and does a cancel would work but you could

    also consider leveraging the startTimeout of the concurrencyPolicy

    https://openliberty.io/docs/20.0.0.8/reference/config/managedExecutorService.html

    In Liberty, EJB asynchronous methods and EJB timers are built on top of the ManagedScheduledExecutorService.

    So, if you are happy with EJB APIs for these, then use EJB, but if you need more flexibility and

    management options, then use ManagedScheduledExecutorService directly.

    The following link has several examples covered:

    https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/rwlp_migrate_to_eeconcurrency.html

    Additional resource:

    https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/twlp_config_ejbasynch.html



    #Support
    #SupportMigration
    #WebSphereLiberty


  • 3.  RE: How do we manage Asynchronous EJBS in Liberty?
    Best Answer

    Posted 11/18/20 04:50 PM


  • 4.  RE: How do we manage Asynchronous EJBS in Liberty?
    Best Answer

    Posted 11/18/20 10:46 PM


  • 5.  RE: How do we manage Asynchronous EJBS in Liberty?
    Best Answer

    Posted 11/21/20 09:28 PM