h1. ServiceMix XMPP
|
{warning:title=Work in progress} This page is currently being reworked...Check back later. {warning}
|
The ServiceMix XMPP component provides support for receiving and sending XMPP messages via the enterprise service bus.
|
...
|
{info:title=Receiver endpoint attributes|borderStyle=solidbgColor='lighblue'} || Name || Type || Description || Default ||
|
| connection | string | sets the connection information | null (must be spec'd) | | deleteProcessedMessages | boolean | delete mail from server when it is processed | false | | processOnlyUnseenMessages | boolean | process only mails which are new (unseen) | true | | marshaler | class | org.apache.servicemix.mail.marshaler.AbstractMailMarshaler | DefaultMailMarshaler | | maxFetchSize | int | sets max amount of mails to fetch, -1 means no limit | -1 | | debugMode | boolean | sets the debug mode for the javamail api | false | | customTrustManagers | string | sets one or more custom trust managers for use with ssl | null |
|
| host | string | sets the host name or ip adress of the XMPP server | null (must be spec'd) | | port | int | the port number of the XMPP service | 5222 | | user | String | the user name of the XMPP account | null (must be spec'd) | | password | String | the password of the XMPP account | null (must be spec'd) | | resource | String | the name of the resource / client | null | | room | String | full room name (for example [email protected]) or null | null (means no room) | | proxyHost | String | the hostname of the proxy to use | null | | proxyPort | String | the port of the proxy to use | 3128 | | proxyUser | String | the user name for the proxy to use | null | | proxyPass | String | the user password for the proxy to use | null | | proxyType | String | the proxy type to use (NONE, HTTP, SOCKS4, SOCKS5) | null | | login | boolean | a flag if the user should login to the XMPP account | true | | createAccount | boolean | a flag if an account should be created for unknown users | false | | filter | class | a class which implements org.jivesoftware.smack.filter.PacketFilter | null | | marshaler | class | a marshaler class which converts XMPP to NMSG | DefaultXMPPMarshaler |
|
{info} {noformat}
|
{info:title=Poller endpoint attributes|borderStyle=solidbgColor='lighblue'} || Name || Description || | protocol | the protocol to use (example: pop3 or imap)| | user | the user name used to log into an account| | host | the name or ip address of the mail server| | port | the port number to use (optional)| | folder | the folder to poll from (optional)| | password | the password for the login| {info}
|
|
h2. Provider Endpoint (Sending)
|
...
|
{info:title=Sender endpoint attributes|borderStyle=solidbgColor='lighblue'} || Name || Type || Description || Default ||
|
| connection | string | sets the connection information | null (must be spec'd) | | sender | string | defines the sender address of the mail | no-re...@localhost | | receiver | string | defines the receiver address of the mail | null | | marshaler | class | org.apache.servicemix.mail.marshaler.AbstractMailMarshaler | DefaultMailMarshaler | | debugMode | boolean | sets the debug mode for the javamail api | false | | ignoreMessageProperties | java.util.List | a list of properties of the IN message which will be ignored | false | | customProperties | java.util.Map | a map of custom properties for the connection | null | | customTrustManagers | string | sets one or more custom trust managers for use with ssl | null |
|
| host | string | sets the host name or ip adress of the XMPP server | null (must be spec'd) | | port | int | the port number of the XMPP service | 5222 | | user | String | the user name of the XMPP account | null (must be spec'd) | | password | String | the password of the XMPP account | null (must be spec'd) | | resource | String | the name of the resource / client | null | | participant | String | the name of the person to chat with (if you specify this, leave room null) | null | | room | String | full room name (if you specify this, leave participant null) | null | | proxyHost | String | the hostname of the proxy to use | null | | proxyPort | String | the port of the proxy to use | 3128 | | proxyUser | String | the user name for the proxy to use | null | | proxyPass | String | the user password for the proxy to use | null | | proxyType | String | the proxy type to use (NONE, HTTP, SOCKS4, SOCKS5) | null | | login | boolean | a flag if the user should login to the XMPP account | true | | createAccount | boolean | a flag if an account should be created for unknown users | false | | marshaler | class | a marshaler class which converts XMPP to NMSG | DefaultXMPPMarshaler |
|
{info}
|
...
|
For providing your own marshaler you only need to implement two methods:
|
h4. toJBI(...) This method is responsible for translating a received XMPP message into a jbi compliant normalized message ready to be sent to the bus.
|
|
h4. convertMailToJBI(...) This method is responsible for translating a received mail message into a jbi compliant normalized message ready to be sent to the bus.
|
|
h4. fromJBI(...) This method is responsible for translating a received normalized message into a XMPP message ready to be sent to the mail server.
|
|
h4. convertJBIToMail(...) This method is responsible for translating a received normalized message into a mail message ready to be sent to the mail server.
|
|
After finishing your marshaler you can simply configure your endpoints to use it: {code:lang=xml|title=Marshaler example}
|
<mail:poller service="test:myMailService"
|
<xmpp:receiver service="test:myJabberService"
|
endpoint="senderEndpoint" endpoint="receiverEndpoint"
|
sender="[email protected]" targetService="test:myJabberProcessor"
|
host="my.jabberserver.lan" port="5222" user="lhein" password="myPassword" createAccount="false"
|
connection="imap://lh...@testserver:143?password=myPass" room="[email protected]" >
|
<property name="marshaler">
|
<bean class="com.mycompany.MyMailMarshaler" class="com.mycompany.MyXMPPMarshaler" />
|
</property>
|
</mail:poller> </xmpp:receiver>
|
{code}
|
...
|