The ActiveMQ project site, 2004–2007 · independent archive
Independent historical archive. This site preserves the ActiveMQ project pages that were published at activemq.org in 2004–2007. It is not the project’s website and is not affiliated with or endorsed by the Apache Software Foundation. ActiveMQ and Apache are trademarks of the ASF. For current downloads and documentation go to activemq.apache.org.

Archive › Documentation › Connectivity › XMPP

Archived page

XMPP

Archived from http://www.activemq.org/site/xmpp.html, captured 2007-01-14 · view the capture · Added by James Strachan, last edited by Hiram Chirino on Nov 18, 2006

XMPP Protocol Support (Jabber!)

We have support for XMPP (Jabber) as a transport in ActiveMQ. It requires Apache ActiveMQ 4.1 or later and the activemq-xmpp library to be on the classpath. (The source code for activemq-xmpp is here).

To use just add a connector as follows

<broker xmlns="http://activemq.org/config/1.0">
    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
       <transportConnector name="stomp"    uri="stomp://localhost:61613"/>
       <transportConnector name="xmpp"     uri="xmpp://localhost:61222"/>
    </transportConnectors>
  </broker>

And you can now use XMPP to connect to the broker & send and receive messages.

XMPP Support in Apache ActiveMQ

ActiveMQ provides a bidirectional bridge between ActiveMQ messages and XMPP.

  • if a client joins a chatroom / conference room, the name of the conference room is mapped to a JMS topic of the same name
  • typing into a chatroom sends a message to the topic
  • 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 XMPP, the Web Console, the Examples or any other Cross Language Clients) are then sent to the chatroom.

Using a Jabber Client

For a good open source Jabber Client we highly recommend Spark. Mac users can also try using iChat

To connect to Apache ActiveMQ try the following...

1. Run the Web Console either from the source code or a binary Download of ActiveMQ 4.1 or later
2. start Spark or whatever Jabber Client you wish
3. login to localhost:61222

4. You should now see the following screen...

5. Now click on the Join Conference Room button (next to the Add Contact button) and the following dialog should appear

6. Now press the Create or Join Room button to get the following dialog. Enter a JMS topic name, in this case foo.bar and you're good to go...

7. Now your chat window should appear for talking and listening to the topic foo.bar. So start typing to test things out. 

 8. Now if you go to the Topic Console in the Web Console you should see the topic has been created

 

9. If you now click on the Send To link next to the foo.bar topic you can send a message to the topic from the web console. 

 

10. Press send and you should see the chat appear on the chat window

 

More from the archive