You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "martin scharm (JIRA)" <ji...@apache.org> on 2016/04/09 12:45:25 UTC

[jira] [Updated] (CAMEL-9847) XMPP: private chat response issue

     [ https://issues.apache.org/jira/browse/CAMEL-9847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

martin scharm updated CAMEL-9847:
---------------------------------
    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

{code:java}
String participant = exchange.getIn().getHeader(XmppConstants.TO, String.class);
{code}
(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

{code:java}
message.setTo(participant);
{code}
(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

  was:
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

{code:java}
String participant = exchange.getIn().getHeader(XmppConstants.TO, String.class);
{code}
(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

{code:java}
message.setTo(participant);
{code}
(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.


> XMPP: private chat response issue
> ---------------------------------
>
>                 Key: CAMEL-9847
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9847
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-xmpp
>    Affects Versions: 2.17.0, 2.18.0
>         Environment: jdk1.8.0_65
>            Reporter: martin scharm
>
> 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
> {code:java}
> String participant = exchange.getIn().getHeader(XmppConstants.TO, String.class);
> {code}
> (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
> {code:java}
> message.setTo(participant);
> {code}
> (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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)