Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0-M3
-
None
-
None
-
Patch Available
Description
It's actually not possible to produce and consume messages from the same XMPP endpoint, i.e. something like:
from("xmpp://irc.jabber.org...").to("direct:out");
from("direct:in").to("xmpp://irc.jabber.org...");
typically what I see happen is that the consumer will work until the XMPP producer sends a message, at that point the consumer stops receiving messages. What's happening is that producers and consumers created from the endpoint also create their own connection object and then also create their own Chat object. The attached patch ties the XMPP connection to the endpoint, making a producer or consumer share this connection. If a consumer creates the Chat first the producer will look it up and connect to the existing Chat. If the producer creates the Chat then the consumer will attach itself as a listener to this Chat.
I notice that the tests are turned off as they require a local Jabber server instance to run. Is it worth creating some accounts on jabber.org to run the test with? Currently I've been testing this patch using my own Google talk accounts, this is all working towards an IRC to Jabber bridge that I might submit later on as a more complicated demo...