Introduction
QMan is a Management bridge that exposes one (or several) Qpid broker domain model as MBeans that are accessible through the Java Management Extensions (JMX).
How to run QMan
Prerequisites
QMan is a standalone application that is packaged as qpid-management-client-incubating-M3.jar. To run QMan you need to add the following jars in your CLASSPATH:
- log4j-1.2.12.jar
- slf4j-api-1.4.0.jar
- slf4j-log4j12-1.4.0.jar
- commons-pool-1.4.jar
- commons-codec-1.3.jar
- commons-lang-2.2.jar
- commons-collections-3.2.jar
- commons-configuration-1.2.jar
- qpid-client-incubating-Mx.jar (were x is the current qpid version)
- qpid-common-incubating-Mx.jar (were x is the current qpid version)
alternatively you can run the following script (that add all the qpid jars to the CLASSPATH):
> CLASSPATH=`find <lib-root> -name '*.jar' | tr '\n' ":"`
Where <lib-root> is the directory containing the qpid jars (when qpid is built from source <lib-root> is equal to qpid/java/build/lib)
QMan can be connected at run time against any broker however it must first connect to a running broker. As default QMan will try to connect to a broker running on localhost port 5672.
The file config.xml that must be located in a directory referenced by the CLASSPATH can be used for configuring QMAN. The default content of this file is:
<configuration> <type-mappings> <mapping> <code>1</code> <class-name>org.apache.qpid.management.domain.model.type.Uint8</class-name> <validator-class-name>org.apache.qpid.management.domain.model.QpidProperty$NumberValidator</validator-class-name> </mapping> <mapping> <code>2</code> <class-name>org.apache.qpid.management.domain.model.type.Uint16</class-name> <validator-class-name>org.apache.qpid.management.domain.model.QpidProperty$NumberValidator</validator-class-name> </mapping> <mapping> <code>3</code> <class-name>org.apache.qpid.management.domain.model.type.Uint32</class-name> <validator-class-name>org.apache.qpid.management.domain.model.QpidProperty$NumberValidator</validator-class-name> </mapping> <mapping> <code>4</code> <class-name>org.apache.qpid.management.domain.model.type.Uint64</class-name> <validator-class-name>org.apache.qpid.management.domain.model.QpidProperty$NumberValidator</validator-class-name> </mapping> <mapping> <code>6</code> <class-name>org.apache.qpid.management.domain.model.type.Str8</class-name> <validator-class-name>org.apache.qpid.management.domain.model.QpidProperty$StringValidator</validator-class-name> </mapping> <mapping> <code>7</code> <class-name>org.apache.qpid.management.domain.model.type.Str16</class-name> <validator-class-name>org.apache.qpid.management.domain.model.QpidProperty$StringValidator</validator-class-name> </mapping> <mapping> <code>8</code> <class-name>org.apache.qpid.management.domain.model.type.AbsTime</class-name> </mapping> <mapping> <code>9</code> <class-name>org.apache.qpid.management.domain.model.type.DeltaTime</class-name> </mapping> <mapping> <code>10</code> <class-name>org.apache.qpid.management.domain.model.type.ObjectReference</class-name> </mapping> <mapping> <code>11</code> <class-name>org.apache.qpid.management.domain.model.type.Boolean</class-name> </mapping> <mapping> <code>14</code> <class-name>org.apache.qpid.management.domain.model.type.Uuid</class-name> </mapping> <mapping> <code>15</code> <class-name>org.apache.qpid.management.domain.model.type.Map</class-name> </mapping> </type-mappings> <access-mode-mappings> <mapping> <code>1</code> <value>RC</value> </mapping> <mapping> <code>2</code> <value>RW</value> </mapping> <mapping> <code>3</code> <value>RO</value> </mapping> </access-mode-mappings> <brokers> <broker> <host>localhost</host> <port>5672</port> <virtual-host>test</virtual-host> <user>guest</user> <password>guest</password> <max-pool-capacity>4</max-pool-capacity> <initial-pool-capacity>0</initial-pool-capacity> <max-wait-timeout>-1</max-wait-timeout> </broker> </brokers> </configuration>
Several brokers can be added so that QMan will try to connect to those broker at starting time.
Running QMan
To run QMan in a console run the following command:
java org.apache.qpid.management.domain.services.QMan
Messages similar to those should be displayed:
2008-10-29 14:45:17,686 INFO [org.apache.qpid.management.domain.services.QMan] <QMAN-000001> : Starting Q-Man... 2008-10-29 14:45:17,687 INFO [org.apache.qpid.management.domain.services.QMan] <QMAN-000002> : Reading Q-Man configuration... 2008-10-29 14:45:17,747 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000005> : Type mapping : code = 1 associated to org.apache.qpid.management.domain.model.type.Uint8 (wraps java.lang.Short) (validator class is org.apache.qpid.management.domain.model.QpidProperty$NumberValidator) 2008-10-29 14:45:17,748 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000005> : Type mapping : code = 2 associated to org.apache.qpid.management.domain.model.type.Uint16 (wraps java.lang.Integer) (validator class is org.apache.qpid.management.domain.model.QpidProperty$NumberValidator) 2008-10-29 14:45:17,750 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000005> : Type mapping : code = 3 associated to org.apache.qpid.management.domain.model.type.Uint32 (wraps java.lang.Long) (validator class is org.apache.qpid.management.domain.model.QpidProperty$NumberValidator) 2008-10-29 14:45:17,752 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000005> : Type mapping : code = 4 associated to org.apache.qpid.management.domain.model.type.Uint64 (wraps java.lang.Long) (validator class is org.apache.qpid.management.domain.model.QpidProperty$NumberValidator) 2008-10-29 14:45:17,753 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000005> : Type mapping : code = 6 associated to org.apache.qpid.management.domain.model.type.Str8 (wraps java.lang.String) (validator class is org.apache.qpid.management.domain.model.QpidProperty$StringValidator) 2008-10-29 14:45:17,754 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000005> : Type mapping : code = 7 associated to org.apache.qpid.management.domain.model.type.Str16 (wraps java.lang.String) (validator class is org.apache.qpid.management.domain.model.QpidProperty$StringValidator) 2008-10-29 14:45:17,755 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000005> : Type mapping : code = 8 associated to org.apache.qpid.management.domain.model.type.AbsTime (wraps java.lang.Long) (validator class is null) 2008-10-29 14:45:17,756 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000005> : Type mapping : code = 9 associated to org.apache.qpid.management.domain.model.type.DeltaTime (wraps java.lang.Long) (validator class is null) 2008-10-29 14:45:17,764 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000005> : Type mapping : code = 10 associated to org.apache.qpid.management.domain.model.type.ObjectReference (wraps [B) (validator class is null) 2008-10-29 14:45:17,765 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000005> : Type mapping : code = 11 associated to org.apache.qpid.management.domain.model.type.Boolean (wraps java.lang.Boolean) (validator class is null) 2008-10-29 14:45:17,766 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000005> : Type mapping : code = 14 associated to org.apache.qpid.management.domain.model.type.Uuid (wraps java.util.UUID) (validator class is null) 2008-10-29 14:45:17,769 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000005> : Type mapping : code = 15 associated to org.apache.qpid.management.domain.model.type.Map (wraps java.util.Map) (validator class is null) 2008-10-29 14:45:17,780 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000006> : Access Mode mapping : code = 1 associated to Read-Create 2008-10-29 14:45:17,781 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000006> : Access Mode mapping : code = 2 associated to Read-Write 2008-10-29 14:45:17,781 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000006> : Access Mode mapping : code = 3 associated to Read-Only 2008-10-29 14:45:17,814 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000009> : Broker configuration 14cc5c2b-f366-4dd5-8128-846b41565a2d: localhost:5672@test 2008-10-29 14:45:17,817 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000007> : Management Queue Message Handler Mapping : opcode = i associated with org.apache.qpid.management.domain.handler.impl.InstrumentationMessageHandler 2008-10-29 14:45:17,817 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000007> : Management Queue Message Handler Mapping : opcode = c associated with org.apache.qpid.management.domain.handler.impl.ConfigurationMessageHandler 2008-10-29 14:45:17,818 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000007> : Management Queue Message Handler Mapping : opcode = e associated with org.apache.qpid.management.domain.handler.impl.EventContentMessageHandler 2008-10-29 14:45:17,818 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000008> : Method-Reply Queue Message Handler Mapping : opcode = m associated with org.apache.qpid.management.domain.handler.impl.MethodResponseMessageHandler 2008-10-29 14:45:17,819 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000008> : Method-Reply Queue Message Handler Mapping : opcode = s associated with org.apache.qpid.management.domain.handler.impl.SchemaResponseMessageHandler 2008-10-29 14:45:17,820 INFO [org.apache.qpid.management.configuration.Configuration] <QMAN-000008> : Method-Reply Queue Message Handler Mapping : opcode = h associated with org.apache.qpid.management.domain.handler.impl.HeartBeatIndicationMessageHandler 2008-10-29 14:45:17,820 INFO [org.apache.qpid.management.domain.services.QMan] <QMAN-000003> : Creating management client(s)... 2008-10-29 14:45:18,152 INFO [org.apache.qpid.management.domain.services.ManagementClient] <QMAN-000016> : Method-reply queue with name reply.2e89e401-5823-4f64-a730-076439503fc7 has been successfully declared and bound on broker 14cc5c2b-f366-4dd5-8128-846b41565a2d. 2008-10-29 14:45:18,152 INFO [org.apache.qpid.management.domain.services.ManagementClient] <QMAN-000015> : Management queue with name management.2e89e401-5823-4f64-a730-076439503fc7 has been successfully declared and bound on broker 14cc5c2b-f366-4dd5-8128-846b41565a2d. 2008-10-29 14:45:18,159 INFO [org.apache.qpid.management.domain.services.ManagementClient] <QMAN-000014> : Management queue consumer has been successfully installed and bound on broker 14cc5c2b-f366-4dd5-8128-846b41565a2d. 2008-10-29 14:45:18,162 INFO [org.apache.qpid.management.domain.services.ManagementClient] <QMAN-000013> : Method-reply queue consumer has been successfully installed and bound on broker 14cc5c2b-f366-4dd5-8128-846b41565a2d. 2008-10-29 14:45:18,217 INFO [org.apache.qpid.management.domain.services.QMan] <QMAN-000004> : Management client for broker 14cc5c2b-f366-4dd5-8128-846b41565a2d successfully connected. 2008-10-29 14:45:18,217 INFO [org.apache.qpid.management.domain.services.QMan] <QMAN-000019> : Q-Man open for e-business. Type "q" to quit.