...
The component supports both room based and private person-person conversations.
The component supports both producer and consumer (you can get messages from xmpp XMPP or send messages to xmppXMPP). Consumer mode supports rooms starting from camel-1.5.0.
You can append query options to the URI in the following format, ?option=value&option=value&...
Options
Name | Description |
---|---|
| If room this option is specified then , the component will connect to MUC (Multi User Chat). Usually, the domain name for MUC is different from the login domain. For example, if you are |
| User name (without server name). If not specified then , anonymous login attempt will be performedattempted. |
| Password. |
| XMPP resource. The default is " |
| If " |
| JID (Jabber ID) of person to receive messages. " |
| Use nick nickname when joining room. If room is specified and nickname is not then ", |
| Camel 1.6/2.0 The name of the service you are connecting to. For Google Talk, this would be |
Headers and setting Subject or Language
Camel sets the message IN headers as properties on the XMPP message. You can configure a HeaderFilterStategy
if you need custom filtering of headers.
In Camel 1.6.2/2.0 the Subject and Language of the XMPP message is are also set if they are provided as IN headers.
Examples
User "superman
" to join room krypton
at jabber
server with password ", secret
".:
Code Block |
---|
xmpp://superman@jabber.org/?room=krypton@conference.jabber.org&password=secret |
User "superman
" to send messages to joker
:
Code Block |
---|
xmpp://superman@jabber.org/joker@jabber.org?password=secret |
Routing example in Java:
Code Block |
---|
from("timer://kickoff?period=10000"). setBody(constant("I will win!\n Your Superman.")). to("xmpp://superman@jabber.org/joker@jabber.org?password=secret"); |
Consumer configuration. Will write , which writes all messages from Joker joker
into a the queue ", evil.talk
".
Code Block |
---|
from("xmpp://superman@jabber.org/joker@jabber.org?password=secret"). to("activemq:evil.talk"); |
Consumer configuration listening , which listens to a room messages (supported from camel-1.5.0):
Code Block |
---|
from("xmpp://superman@jabber.org/?password=secret&room=krypton@conference.jabber.org"). to("activemq:krypton.talk"); |
Room in short notation (no domain part; for camel-1.5.0+):
Code Block |
---|
from("xmpp://superman@jabber.org/?password=secret&room=krypton"). to("activemq:krypton.talk"); |
When connecting to the Google Chat service, you'll need to specify the serviceName
as well as your credentials (as of Camel 1.6/2.0):
Wiki Markup |
---|
{snippet:id=e1|lang=java|url=camel/trunk/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/GoogleTalkTest.java} |
...