0 Replies Latest reply on Dec 15, 2016 9:47 AM by mattrih

    DeliveryActive - Set this within code to start/stop a Message Driven Bean

    mattrih

      Hi,

       

      I have looked into the DeliveryActive annotation for message driven beans and am wondering if it is possible to set this value programmatically.

       

      @DeliveryActive(false)
      public class MyJmsListener implements MessageListener {
      

       

      I want to be able to start my system in a "paused" state in the event of recovering from failure so am using this flag on my MDBs. However as this annotation is a compile time setting and is already set to false (i.e. don't start-up) in my WAR file I am wondering how the industry standard way of instantiating the MDB is on start-up for "normal" behaviour.

       

      I am aware of the Command Line tool and am able to start my beans manually but I would like to have an automated way of re-enabling the beans for normal behaviour. Something along the lines of reading in a property file and calling the startDelivery() method for each MDB within the application itself.

       

      Is there any way to do this? or am I missing the standard way of starting the delivery?

       

      I have been looking at the code in wildfly/MessageDrivenComponent.java at master · wildfly/wildfly · GitHub, but I am not sure how I can reach or use any of it without using the command line tool.

      Any help is appreciated.

       

      Kind regards,

       

      Matt