XMPPPage edited by willem jiangXMPP ComponentThe xmpp: component implements an XMPP (Jabber) transport. Maven users will need to add the following dependency to their pom.xml for this component:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-xmpp</artifactId>
<version>x.x.x</version>
<!-- use the same version as your Camel core version -->
</dependency>
Headers and setting Subject or LanguageCamel sets the message IN headers as properties on the XMPP message. You can configure a HeaderFilterStategy if you need custom filtering of headers. ExamplesUser superman to join room krypton at jabber server with password, secret:
xmpp://[email protected]/[email protected]&password=secret
User superman to send messages to joker:
xmpp://[email protected]/[email protected]?password=secret
Routing example in Java: from("timer://kickoff?period=10000"). setBody(constant("I will win!\n Your Superman.")). to("xmpp://[email protected]/[email protected]?password=secret"); Consumer configuration, which writes all messages from joker into the queue, evil.talk. from("xmpp://[email protected]/[email protected]?password=secret"). to("activemq:evil.talk"); Consumer configuration, which listens to room messages (supported from camel-1.5.0): from("xmpp://[email protected]/?password=secret&[email protected]"). to("activemq:krypton.talk"); Room in short notation (no domain part; for camel-1.5.0+): from("xmpp://[email protected]/?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): // send a message from [email protected] to [email protected] from("direct:start"). to("xmpp://talk.google.com:5222/[email protected]?servicename=gmail.com&user=fromuser&password=secret"). to("mock:result"); See Also
Change Notification Preferences
View Online
|
View Change
|
Add Comment
|
