blob: 70ab60efda364dd6ea08ea393d6e32d0d9ea6199 [file] [log] [blame]
<div class="wiki-content maincontent"><h2>XMPP Protocol Support (Jabber!)</h2>
<structured-macro ac:macro-id="32c335e0-52cc-45b0-9962-3a0899c44e92" ac:name="warning" ac:schema-version="1"><parameter ac:name="title">Deprecated</parameter><rich-text-body>
<p>This transport was deprecated in 5.8.0 and has been removed in a 5.9.0!</p></rich-text-body></structured-macro>
<p>We have support for <a shape="rect" href="http://www.xmpp.org/">XMPP</a> (Jabber) as a transport in ActiveMQ.</p>
<p>To use just add a connector as follows</p>
<structured-macro ac:macro-id="633f3d25-a0b8-48b6-aeae-85fb93858d4e" ac:name="code" ac:schema-version="1"><plain-text-body>
&lt;broker xmlns="http://activemq.org/config/1.0"&gt;
&lt;transportConnectors&gt;
&lt;transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/&gt;
&lt;transportConnector name="stomp" uri="stomp://localhost:61613"/&gt;
&lt;transportConnector name="xmpp" uri="xmpp://localhost:61222"/&gt;
&lt;/transportConnectors&gt;
&lt;/broker&gt;
</plain-text-body></structured-macro>
<p>And you can now use XMPP to connect to the broker &amp; send and receive messages.</p>
<structured-macro ac:macro-id="b5d113d5-3a2f-4dad-9916-0d828203f4b0" ac:name="warning" ac:schema-version="1"><parameter ac:name="">Classpath</parameter><rich-text-body>
<p>Some versions of the broker (5.0-5.2) does not include <a shape="rect" href="http://woodstox.codehaus.org/">WoodStox</a> library by default, which could impact ActiveMQ XMPP funcionality. You should have a library named like <code>wstx-asl-x.x.x.jar</code> in the <code>lib/optional</code> directory of your broker. If that's not the case, download it from <a shape="rect" href="http://woodstox.codehaus.org/">here</a> and put it in the classpath</p></rich-text-body></structured-macro>
<h3>XMPP Support in Apache ActiveMQ</h3>
<p>ActiveMQ provides a bidirectional bridge between ActiveMQ messages and XMPP.</p>
<ul><li>if a client joins a chatroom / conference room, the name of the conference room is mapped to a JMS topic of the same name</li><li>typing into a chatroom sends a message to the topic</li><li>presence in a chatroom maintains a subscription on the JMS topic (using noLocal to avoid getting copies of things you say) so that messages sent by other clients (via <link></link>, the <link><page ri:content-title="Web Console"></page></link>, the <link><page ri:content-title="Examples"></page></link> or any other <link><page ri:content-title="Cross Language Clients"></page></link>) are then sent to the chatroom.</li></ul>
<h3>Using a Jabber Client</h3>
<p>Basically, you should be able to connect from any Jabber-compatible client to the broker. The below example is using <a shape="rect" href="http://jivesoftware.com/products/spark/">Spark</a> 2.0.0 version. For more details on connecting with different clients take a look at <link ac:anchor="Jabber clients compatibility"><link-body>#Jabber clients compatibility</link-body></link>.</p>
<p>To connect to Apache ActiveMQ try the following...</p>
<p>1. Run the <link><page ri:content-title="Web Console"></page></link><br clear="none">
2. Start <a shape="rect" href="http://jivesoftware.com/products/spark/">Spark</a> or whatever Jabber Client you wish<br clear="none">
3. Login to localhost:61222</p>
<structured-macro ac:macro-id="de4500b9-8d17-4ab8-82c3-a4ada7947169" ac:name="warning" ac:schema-version="1"><parameter ac:name="">Username</parameter><rich-text-body>
<p>Some Jabber clients (like iChat) insist on usernames in forms of <em>username@host</em>, so in that case just append <em>@localhost</em> to your username</p></rich-text-body></structured-macro>
<p><image><attachment ri:filename="step1.png"></attachment></image></p>
<structured-macro ac:macro-id="7214f204-39ac-4b3c-898e-c7ad1a8e366c" ac:name="warning" ac:schema-version="1"><parameter ac:name="">Careful about auto-discovery</parameter><rich-text-body>
<p>Some Jabber clients like to auto-discover the host and port. You need to explicitly disable this feature so you can explicitly configure <strong>localhost</strong> as the host and <strong>61222</strong> as the port.</p>
<p>e.g. on Spark go to the <strong>Advanced</strong> tab and disable the <strong>Automatically discover host and port</strong></p></rich-text-body></structured-macro>
<p>4. You should now see the following screen...</p>
<p><image><attachment ri:filename="step2.png"></attachment></image></p>
<p>5. Now click on the <strong>Join Conference Room</strong> button (next to the Add Contact button) and the following dialog should appear</p>
<p><image><attachment ri:filename="step3.png"></attachment></image></p>
<p>6. Now press the <strong>Create or Join Room</strong> button to get the following dialog. Enter a JMS topic name, in this case <strong>foo.bar</strong> and you're good to go...</p>
<p><image><attachment ri:filename="step4.png"></attachment></image></p>
<p>7. Now your chat window should appear for talking and listening to the topic <strong>foo.bar</strong>. So start typing to test things out.&#160;</p>
<p><image><attachment ri:filename="step5.png"></attachment></image></p>
<p>&#160;8. Now if you go to the <a shape="rect" href="http://localhost:8161/admin/topics.jsp">Topic Console</a> in the Web Console you should see the topic has been created</p>
<p>&#160;<image><attachment ri:filename="step6-new.png"></attachment></image></p>
<p>9. If you now click on the <strong>Send To</strong> link next to the <strong>foo.bar</strong> topic you can send a message to the topic from the web console.&#160;</p>
<p>&#160;<image><attachment ri:filename="step7-new.png"></attachment></image></p>
<p>10. Press send and you should see the chat appear on the chat window <emoticon ac:name="smile"></emoticon></p>
<p>&#160;<image><attachment ri:filename="step8.png"></attachment></image></p>
<h3>Jabber clients compatibility</h3>
<p>Here you can find specfic issues and workarounds for various Jabber clients. If you have some of your own, please post them here.</p>
<h4>Spark</h4>
<p>Url: <a shape="rect" href="http://www.igniterealtime.org/projects/spark/index.jsp">http://www.igniterealtime.org/projects/spark/index.jsp</a><br clear="none">
Spark 2.0.0 works fine with ActiveMQ; Click <a shape="rect" href="http://www.igniterealtime.org/downloads/download-landing.jsp?file=spark/spark_2_ 0_0.exe">here</a> to download: <a shape="rect" href="http://www.igniterealtime.org/downloads/download-landing.jsp?file=spark/spark_2_0_0.exe">Spark 2.0.0 for Windows</a>.<br clear="none">
Spark 2.5.x connects fine, but it won't open the <strong>Join Conference Room</strong> dialog.</p>
<h4>iChat</h4>
<p>Url: <a shape="rect" href="http://www.apple.com/macosx/features/ichat.html">http://www.apple.com/macosx/features/ichat.html</a><br clear="none">
Tested version 4.0.7 works fine, but it insists you use <em>username@host</em> format for usernames</p>
<h4>Adium</h4>
<p>Url: <a shape="rect" href="http://www.adiumx.com/">http://www.adiumx.com/</a><br clear="none">
Tested version 1.3.3 works fine. The only spotted issue is reconnecting to <link><page ri:content-title="Command Agent"></page></link> topic. We recommend that you restart the Adium if you need to do this </p></div>