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

XMPP: private chat response issue

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.17.0
    • Fix Version/s: 2.16.4, 2.17.1, 2.18.0
    • Component/s: camel-xmpp
    • Labels:
      None
    • Environment:

      jdk1.8.0_65

    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Unknown

      Description

      There is an issue in the org.apache.camel.component.xmpp.XmppPrivateChatProducer that prevents responding to XMPP private chat messages. The participant's address is obtained as

      String participant = exchange.getIn().getHeader(XmppConstants.TO, String.class);
      

      (see https://github.com/apache/camel/blob/4ad8bcfde6ba931e526cd8680e211a397c6c71e7/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java#L68)

      In case of an incoming message that is the camel instance itself, not the participant. However, from that it creates the outgoing message just as

      message.setTo(participant);
      

      (see https://github.com/apache/camel/blob/4ad8bcfde6ba931e526cd8680e211a397c6c71e7/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java#L82)

      Thus, responding to a chat message always results in a message to itself and not the chat's other participant.

      I fixed the issue in https://github.com/binfalse/camel/commit/cbada76346fa0aae74128b2b74aa3a834144ea63 by using the endpoint.getParticipant() to set the receipient of the message. Based on that I created a pull request on github: https://github.com/apache/camel/pull/938

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: