In your application, load or create your queue manager and activate it
as usual. Now, create JMX MBeans for your queue manager and its resources
as follows:
MQeQueueManagerJmx.createMQeMBeans(mbServer);
where
mbServer is your instance of MBeanServer.
This method creates and registers MBeans for all of your queue manager
resources: queues, bridge objects, connections and listeners.
Note: Whenever MQe resources are created or removed from this point, corresponding
MBeans are also registered with or deregistered from the MBeanServer instance.
It is strongly recommended that you do not create and register or deregister
MQe MBeans independently of using the MQe interface, otherwise the MQe MBean
representations may not be consistent and may not function as intended. For
example, you should not use the register/unregister facilities offered by
various adapters. Using the MQe JMX interface to create and delete methods
ensures that MBeans are registered and unregistered in the approved manner.
However, the AdminBean is an exception to this rule – see
ObjectName.
You need to create one or more connectors or adaptors to allow JMX management
clients to connect to and manage your MQe applications. Both the Sun and Tivoli® JMX
Reference Implementations provide adaptors which allow you to manage your
MQe application through a web browser. Please refer to the reference implementations
for documentation and examples.
In addition to the HtmlAdaptorServer, the Sun JDMK provides the HttpConnectorServer,
HttpsConnectorServer, the RmiConnectorServer, and the SnmpAdaptorServer.
These allow JMX management clients to connect to and manage JMX manageable
resources using the HTTP, HTTPS, RMI, and SNMP protocols. Refer to the JDMK
for documentation and examples.
Once you have your connector(s) or adaptor(s), or both, you are in a position
to access the MQe MBeans as specified in the JMX specification. You need to
have all of the following queues set up:
- An admin queue on your local queue manager for local administration.
The default assumes that this queue is named AdminQ but you can re-set this
using the Admin MBean (see Admin MBean).
- An admin reply queue called AdminReplyQ.
- Queues named AdminQ and AdminReplyQ on any remote queue managers that
you wish to manage via the JMX interface. If either of these queues does
not exist (or the relevant connection definitions and listeners for remote
two-way admin-adminReply communication do not exist), you may experience problems
when performing remote administration.
When you have closed your MQe queue manager at the end of your application,
you must invoke the following static method to ensure that all MQe JMX resources
are cleaned up:
MQeQueueManagerJmx.endMQeJMXSession()
It
is important that this method is called after the queue manager has been closed.