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

XMPP chat responding not woring

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 2.17.0
    • None
    • camel-xmpp
    • None
    • jdk1.8.0_65

    • Unknown

    Description

      I tried to implement a simple XMPP bot, but reading and responding to the same XMPP chat seems to fail: The bot sends the message to itself.

      The endpoint is created like the following:

      String
      userA = "bot",
      userB = "human",
      server = "SERVER",
      port = "5222",
      passwordA = "secret";
      
      final String chatEndpoint =
            String.format("xmpp://%s@%s:%s/%s@%s?password=%s",
                    userA, server, port,
                    userB, server, passwordA);
      

      which produces an endpoint such as xmpp://bot@SERVER:5222/human@SERVER?password=secret, so the bot authenticates with SERVER and it will talk to human@SERVER.

      The bot is able to read from XMPP and dump the messages to std::out:

      from(chatEndpoint)
      .to("stream:out");
      

      And the bot is able to send XMPP messages:

      from("timer://foo?fixedRate=true&period=1000")
      .setBody(constant("test"))
      .to(chatEndpoint); 
      

      So far, I'm really impressed

      However, simply responding the human's message fails:

      from(chatEndpoint)
      .to(chatEndpoint);
      

      My XMPP server (prosody) shows me, that the bot sends the messages to itself:

      debug   Received[c2s]: <message id='g0x1L-5' type='chat' to='bot@SERVER' from='bot@SERVER/Camel'>
      

      But I have no idea why.. Am I doing something wrong?
      I tried adding &participant=human@SERVER to the chatEndpoint which doesn't solve the issue. I also tried to create two separate chat endpoints with different resource names, but that didn't work either.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            binfalse martin scharm
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: