1 Reply Latest reply on Apr 21, 2005 8:52 AM by adrian.bigland

    Accessing through JMX (MBean vs. EJB)

    Brian Woo Newbie

      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: Accessing through JMX (MBean vs. EJB)
          adrian.bigland Newbie

          I don't think there is a general J2EE solution because you can't change the ENC once the MDB is deployed - so it has to remain listening to the same queue and you can't change the env-entry values.

          You could use setters/getters on your EJBs, but you would lose these changes whenever you get a newly created EJB, and the container decides when this happens, mainly.

          However, you could use system properties to hold destination queues for each component (and use the systemproperties service to change them) - or create your own service to hold this state - then you could look up the destination via JMX from your EJB, and this would change whenever you change the property.

          Or you could have them all listen to the same queue, but use message filters on the MDBs so that EJBs specify who gets their message when they send it - and then you could use a similar system to that above to change this dynamically.