1 Reply Latest reply on Apr 21, 2005 7:53 PM by genman

    Changing Queue information on the fly.... through JMX consol

    dookie23

      Hi all,

      Is there a way to change an attribute value (in an EJB) through the JMX console (maybe through some getters/setters)?

      I am asking this question because of the following scenario:

      I am trying to have an MDB (A) sending messages to MDB (B), and B to C, C to D.... so on...:

      A -> B -> C -> D

      If I have a new MDB (E), and I need to insert that between A and B:

      A -> E -> B -> C -> D

      Is there a way to change the queue/B (A is currently accessing) to queue/E at run time? I know I could store all the queue information in an XML file or something, but.... Using the JMX console would be an excellent choice for this type of thing. This makes chaining queues much easier. I have been digging but no solution on the web....

      Does anyone have any suggestions? Thanks.

        • 1. Re: Changing Queue information on the fly.... through JMX co
          genman

          You can have your EJB's call a JMX MBean. E.g.

          MBeanServer server; // find this out somehow
          ObjectName on; // MBean someplace
          QueueConnectionFactory cf; // create in ejbCreate
          
          onMessage(Message m) {
           Queue q = (Queue)server.getAttribute(on, "Queue");
           QueueSender qs = ...
           qs.send(m);
          }
          


          Note: You probably want the queue session transacted.