Runtime Administration Via JMX

JBossMQ statistics and several management functions are accessible via JMX. JMX can be accessed interactively via a Web Application or programmatically via the JMX API. It is recommended that you use the http://localhost:8080/jmx-console web application to become familiar with all the JBossMQ JMX MBeans running inside the server and how to invoke methods on those MBeans via the jmx-console web application.

The following section will outline the most common runtime management tasks that administrators can perform.

Creating Queues At Runtime

Applications that require the dynamic creation of queues at runtime can use the Destination Manager’s MBean createQueue method:

void createQueue(String name, String jndiLocation)

This method creates a queue with the given name and binds it in JNDI at the jndiLocation. Queues created via this method exist until the server is restarted.

To destroy a previously created Queue, you would issue a:

void destroyQueue(String name)

Creating Topics At Runtime

Applications that require the dynamic creation of topics at runtime can use the Destination Manager’s MBean createTopic method:

void createTopic(String name, String jndiLocation)

This method creates a topic with the given name and binds it in JNDI at the jndiLocation. Topics created via this method exist until the server is restarted.

To destroy a previously created Topic, you would issue a:

void destroyTopic(String name)

Managing a JBossMQ User IDs at Runtime

The org.jboss.mq.sm.file.DynamicStateManager’s MBean can be used to add and remove user ids and roles at runtime. To add a user id, you would use:

void addUser(String name, String password, String clientID)

This method creates a user id with the given name and password and configures it to have the given clientID.

To remove a previously created user id, you would call the following method:

void removeUser(String name)

To manage the roles that the user ids belong to, you would use the following set of methods to create roles, remove roles, add users to roles, and remove users from roles:

void addRole(String name)
void removeRole(String name)
void addUserToRole(String roleName, String user)
void removeUserFromRole(String roleName, String user)