Reference: Core Server Management
30.1.1.1. Core Server Management Listing, creating, deploying and destroying queues A list of deployed core queues can be retrieved using the getQueueNames() method. Core queues can be created or destroyed using the management operations createQueue() or deployQueue() or destroyQueue())on the HornetQServerControl (with the ObjectName org.hornetq:module=Core,type=Server or the resource name core.server) createQueue will fail if the queue already exists while deployQueue will do nothing. Pausing and resuming Queues The QueueControl can pause and resume the underlying queue. When a queue is paused, it will receive messages but will not deliver them. When it's resumed, it'll begin delivering the queued messages, if any. Listing and closing remote connections Client's remote addresses can be retrieved using listRemoteAddresses(). It is also possible to close the connections associated with a remote address using the closeConnectionsForAddress() method. Alternatively, connection IDs can be listed using listConnectionIDs() and all the sessions for a given connection ID can be listed using listSessions(). Transaction heuristic operations In case of a server crash, when the server restarts, it it possible that some transaction requires manual intervention. The listPreparedTransactions() method lists the transactions which are in the prepared states (the transactions are represented as opaque Base64 Strings.) To commit or rollback a given prepared transaction, the commitPreparedTransaction() or rollbackPreparedTransaction() method can be used to resolve heuristic transactions. Heuristically completed transactions can be listed using the listHeuristicCommittedTransactions() and listHeuristicRolledBackTransactions methods. Enabling and resetting Message counters Message counters can be enabled or disabled using the enableMessageCounters() or disableMessageCounters() method. To reset message counters, it is possible to invoke resetAllMessageCounters() and resetAllMessageCounterHistories() methods. Retrieving the server configuration and attributes The HornetQServerControl exposes HornetQ server configuration through all its attributes (e.g. getVersion() method to retrieve the server's version, etc.) Listing, creating and destroying Core bridges and diverts A list of deployed core bridges (resp. diverts) can be retrieved using the getBridgeNames() (resp. getDivertNames()) method. Core bridges (resp. diverts) can be created or destroyed using the management operations createBridge() and destroyBridge() (resp. createDivert() and destroyDivert()) on the HornetQServerControl (with the ObjectName org.hornetq:module=Core,type=Server or the resource name core.server).