Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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. However if you wish to automatically connect to one or several brokers you can do so by providing a configuration file as follows:

Code Block
<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>
			
  <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>
        <broker>
	  <host>myhost</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 The configuration above specifies that QMan will try to connect to those broker at starting timeshould connect to two brokers, one on localhos and one on myhost, both listening on port 5672.

The configuration file to use is specified through the JVM parameter "qman-config" that must point onto a valid configuration file.

Running QMan

To run QMan in a console run the following command:

...

Code Block
... [org.apache.qpid.management.domain.services.QMan] <QMAN-000001> : Starting Q-Man...
...
Type "q" to quit.

if you wish to use a configuration file <home>/myconfiguration.xml so QMan establishes a connection with one or several brokers, run the following command:

Code Block

java -Dqman-config="<home>/myconfiguration.xml" org.apache.qpid.management.domain.services.QMan

Stopping QMan

Type "q" In the console from which QMan has been started.

...

The jconsole executable can be found in JDK_HOME/bin, where JDK_HOME is the directory in which the JDK software is installed. If this directory is in your system path, you can start JConsole by simply typing jconsole in a console. Otherwise, you have to type the full path to the executable file.

As jconsole needs to perform operations invocation you will need to add the QMan jar in jconsole classpath. In a console type:

Code Block

jconsole -J-Djava.class.path=$CLASSPATH:$JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/lib/tools.jar

Where CLASSPATH contains the QMan jars and JAVA_HOME point on your JDK home.

As demonstrated on the following screen shot, once jconsole is running select the MBeans tab and select the Q-MAN set of MBeans.

...