Announcement Announcement Module
No announcement yet.
Spring Integration XMPP for MULTIPLE OAuth Connections. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Integration XMPP for MULTIPLE OAuth Connections.


    I am writting a web service that receives an gtalk 'access_token' and should get friends and send messages throw gtalk from and to multiple users.

    Based on spring integration xmpp sample code and the manual, I was able to make it working for a SINGLE user with oauth by writting my own ConnectionConfiguration setting (SASL Mechanism) as I needed and injecting this xmpp connection as a singleton/normal spring bean directly into the "outbound-channel-adapter" name space
    rather than use "xmpp-connection" namespace to create the connection.

    I am new with Spring Integration and my challange starts exactly because my web service will serve multiple different users simultaneously. In other words, I can not use the XMPPConnection as a singleton into the "outbound-channel-adapter" namespace once each different user has different oauth data.

    Do you have any suggestion to solve this situation with spring integration?

    Thanks in advance.

  • #2
    You can explicitly provide the xmpp-connection reference to the adapter rather than relying on the default bean name (which is "xmppConnection"). That way you can define multiple XmppConnection beans. In fact, you can use the xmpp-connection element in the XML namespace; just be sure to provide an explicit value for its "id" attribute rather than relying on the default there as well.

    Hope that helps.