blob: b6a144a926f294023673371864f0b35ec635fe0c [file] [log] [blame]
<div class="wiki-content maincontent"><h2 id="XMPP-XMPPProtocolSupport(Jabber!)">XMPP Protocol Support (Jabber!)</h2>
<div class="confluence-information-macro confluence-information-macro-warning"><p class="title">Deprecated</p><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body">
<p>This transport was deprecated in 5.8.0 and has been removed in a 5.9.0!</p></div></div>
<p>We have support for <a shape="rect" class="external-link" href="http://www.xmpp.org/" rel="nofollow">XMPP</a> (Jabber) as a transport in ActiveMQ.</p>
<p>To use just add a connector as follows</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;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;
</pre>
</div></div>
<p>And you can now use XMPP to connect to the broker &amp; send and receive messages.</p>
<div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body">
<p>Some versions of the broker (5.0-5.2) does not include <a shape="rect" class="external-link" href="http://woodstox.codehaus.org/" rel="nofollow">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" class="external-link" href="http://woodstox.codehaus.org/" rel="nofollow">here</a> and put it in the classpath</p></div></div>
<h3 id="XMPP-XMPPSupportinApacheActiveMQ">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 <a shape="rect" href="xmpp.html">XMPP</a>, the <a shape="rect" href="web-console.html">Web Console</a>, the <a shape="rect" href="examples.html">Examples</a> or any other <a shape="rect" href="cross-language-clients.html">Cross Language Clients</a>) are then sent to the chatroom.</li></ul>
<h3 id="XMPP-UsingaJabberClient">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" class="external-link" href="http://jivesoftware.com/products/spark/" rel="nofollow">Spark</a> 2.0.0 version. For more details on connecting with different clients take a look at <a shape="rect" href="xmpp.html">#Jabber clients compatibility</a>.</p>
<p>To connect to Apache ActiveMQ try the following...</p>
<p>1. Run the <a shape="rect" href="web-console.html">Web Console</a><br clear="none">
2. Start <a shape="rect" class="external-link" href="http://jivesoftware.com/products/spark/" rel="nofollow">Spark</a> or whatever Jabber Client you wish<br clear="none">
3. Login to localhost:61222</p>
<div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-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></div></div>
<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="xmpp.data/step1.png"></span></p>
<div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-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></div></div>
<p>4. You should now see the following screen...</p>
<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="xmpp.data/step2.png"></span></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><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="xmpp.data/step3.png"></span></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><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="xmpp.data/step4.png"></span></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><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="xmpp.data/step5.png"></span></p>
<p>&#160;8. Now if you go to the <a shape="rect" class="external-link" href="http://localhost:8161/admin/topics.jsp" rel="nofollow">Topic Console</a> in the Web Console you should see the topic has been created</p>
<p>&#160;<span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="xmpp.data/step6-new.png"></span></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;<span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="xmpp.data/step7-new.png"></span></p>
<p>10. Press send and you should see the chat appear on the chat window <img class="emoticon emoticon-smile" src="https://cwiki.apache.org/confluence/s/en_GB/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/smile.png" data-emoticon-name="smile" alt="(smile)"></p>
<p>&#160;<span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="xmpp.data/step8.png"></span></p>
<h3 id="XMPP-Jabberclientscompatibility">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 id="XMPP-Spark">Spark</h4>
<p>Url: <a shape="rect" class="external-link" href="http://www.igniterealtime.org/projects/spark/index.jsp" rel="nofollow">http://www.igniterealtime.org/projects/spark/index.jsp</a><br clear="none">
Spark 2.0.0 works fine with ActiveMQ; Click <a shape="rect" class="external-link" href="http://www.igniterealtime.org/downloads/download-landing.jsp?file=spark/spark_2_ 0_0.exe" rel="nofollow">here</a> to download: <a shape="rect" class="external-link" href="http://www.igniterealtime.org/downloads/download-landing.jsp?file=spark/spark_2_0_0.exe" rel="nofollow">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 id="XMPP-iChat">iChat</h4>
<p>Url: <a shape="rect" class="external-link" href="http://www.apple.com/macosx/features/ichat.html" rel="nofollow">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 id="XMPP-Adium">Adium</h4>
<p>Url: <a shape="rect" class="external-link" href="http://www.adiumx.com/" rel="nofollow">http://www.adiumx.com/</a><br clear="none">
Tested version 1.3.3 works fine. The only spotted issue is reconnecting to <a shape="rect" href="command-agent.html">Command Agent</a> topic. We recommend that you restart the Adium if you need to do this </p></div>