blob: 2981cb6ada14ada65f4e253f04696d7322cf22a5 [file] [log] [blame]
<div class="wiki-content maincontent"><div class="confluence-information-macro confluence-information-macro-warning"><p class="title">Removed in 5.9</p><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><ul class="alternate"><li><a shape="rect" class="external-link" href="https://issues.apache.org/jira/browse/AMQ-4406">https://issues.apache.org/jira/browse/AMQ-4406</a></li></ul>
</div></div>
<h2 id="CommandAgent-CommandAgent">Command Agent</h2>
<p>From 4.2 onwards Apache ActiveMQ allows you to communicate with a broker Command Agent to be able to perform administration queries and commands. This allows you to use the message bus itself to communicate with the message broker to list available queues, topics, subscriptions, to view metadata, browse queues and so forth.</p>
<h3 id="CommandAgent-EnablingtheCommandAgent">Enabling the Command Agent</h3>
<p>To enable the command agent, in the activemq.xml (or your spring.xml you use to configure the broker) add the following</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
&lt;beans&gt;
&lt;broker useJmx="true" xmlns="http://activemq.apache.org/schema/core"&gt;
...
&lt;managementContext&gt;
&lt;managementContext createConnector="true"/&gt;
&lt;/managementContext&gt;
...
&lt;/broker&gt;
&lt;commandAgent xmlns="http://activemq.apache.org/schema/core"/&gt;
...
&lt;/beans&gt;
</pre>
</div></div>
<p>The broker will then have a command agent connected which will listen on the topic <strong>ActiveMQ.Agent</strong>.</p>
<h3 id="CommandAgent-UsingJabber(XMPP)totalktotheBroker">Using Jabber (XMPP) to talk to the Broker</h3>
<p>You can use the <a shape="rect" href="xmpp.html">XMPP</a> support to talk with the broker. For example follow the instructions in <a shape="rect" href="xmpp.html">XMPP</a> to connect via a Jabber client, then just join the room <strong>ActiveMQ.Agent</strong> and talk to the broker!</p>
<p>The following image shows the <a shape="rect" class="external-link" href="http://jivesoftware.com/products/spark/" rel="nofollow">Spark</a> client in action talking to the broker</p>
<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="command-agent.data/help.png"></span></p>
<h3 id="CommandAgent-Usingtheinteractiveconsole">Using the interactive console</h3>
<p>The activemq-core module has a simple Java class called SimpleConsole which you can run in your IDE to get an interactive console for communicating with a broker over JMS. Type in the various commands (or help to get more help) and the results are returned on the console.</p></div>