You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

XMPP Component

The xmpp: component implements an XMPP (Jabber) transport.

URI format

xmpp://[login@]hostname[:port][/participant][?Options]

The component supports both room based and private person-person conversations.
The component supports both producer and consumer (you can get messages from xmpp or send messages to xmpp). Consumer mode supports rooms starting from camel-1.5.0.

Options

Name

Description

room

If room is specified then component will connect to MUC (Multi User Chat). Usually domain name for MUC is different from login domain. For example if you are superman@jabber.org and want to join "krypton" room then room url is krypton@conference.jabber.org. Note "conference" part.
Starting from camel-1.5.0 it is not required to provide full room JID. If room parameter does not contain "@" symbol then domain part will be discovered and added by Camel

user

User name (without server name). If not specified then anonymous login attempt will be performed.

password

Password

resource

XMPP resource. The default is "Camel"

createAccount

If "true" then an attempt to create an account will be made. Default is false

participant

JID (Jabber ID) of person to receive messages. "room" parameter has precedence over "participant".

nickname

Use nick when joining room. If room is specified and nickname is not then "user" will be used for nick

serviceName

The name of the service you are connecting to. For Google Talk, this would be gmail.com

Examples

User "superman" to join room krypton at jabber server with password "secret".

xmpp://superman@jabber.org/?room=krypton@conference.jabber.org&password=secret

User "superman" to send messages to joker

xmpp://superman@jabber.org/joker@jabber.org?password=secret

Routing example in Java

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 all messages from Joker into a queue "evil.talk".

from("xmpp://superman@jabber.org/joker@jabber.org?password=secret").
to("activemq:evil.talk");

Consumer configuration listening to a room messages (supported from camel-1.5.0)

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+)

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

  • No labels