Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-1884

XMPP producer and consumer don't share the same connection and Chat objects

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0-M3
    • 2.0.0
    • 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...

      Attachments

        1. patch.txt
          13 kB
          Stanley J. Lewis
        2. patch.txt
          9 kB
          Stanley J. Lewis

        Activity

          People

            njiang Willem Jiang
            slewis Stanley J. Lewis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: