You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/07/31 05:30:09 UTC

[camel] branch backport-camel-15349 created (now e76138f)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch backport-camel-15349
in repository https://gitbox.apache.org/repos/asf/camel.git.


      at e76138f  Camel 15349 (#4058)

This branch includes the following new commits:

     new 4327c32  Merge branch 'camel-3.4.x' of github.com:apache/camel into camel-3.4.x
     new e76138f  Camel 15349 (#4058)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel] 01/02: Merge branch 'camel-3.4.x' of github.com:apache/camel into camel-3.4.x

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch backport-camel-15349
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 4327c32eb37a60fe47bb66df269e24c3cef42573
Merge: a2c3fa8 b96cc3b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jul 31 07:27:12 2020 +0200

    Merge branch 'camel-3.4.x' of github.com:apache/camel into camel-3.4.x

 .../camel/component/rabbitmq/RabbitMQConstants.java      |  1 +
 .../camel/component/rabbitmq/RabbitMQDeclareSupport.java |  5 +++++
 .../camel/component/rabbitmq/RabbitMQEndpointTest.java   | 16 ++++++++++++++++
 .../rabbitmq/integration/RabbitMQConsumerIntTest.java    |  2 +-
 4 files changed, 23 insertions(+), 1 deletion(-)


[camel] 02/02: Camel 15349 (#4058)

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch backport-camel-15349
in repository https://gitbox.apache.org/repos/asf/camel.git

commit e76138f7d1c49fef565010535ac8ebcc79f9277d
Author: vindiagram-ng <68...@users.noreply.github.com>
AuthorDate: Fri Jul 31 01:22:55 2020 -0400

    Camel 15349 (#4058)
    
    * Added function to resolve fully qualified JID for participants
    
    Changed the consumer to get the entityBareFrom the resolved participant
    JID
    
    * Fixed formatting issues outlined by sourcecheck
---
 .../java/org/apache/camel/component/xmpp/XmppConsumer.java |  2 +-
 .../java/org/apache/camel/component/xmpp/XmppEndpoint.java | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
index 37b643c..99be956 100644
--- a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
+++ b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
@@ -95,7 +95,7 @@ public class XmppConsumer extends DefaultConsumer implements IncomingChatMessage
         }
 
         if (endpoint.getRoom() == null) {
-            privateChat = chatManager.chatWith(JidCreate.entityBareFrom(endpoint.getChatId()));
+            privateChat = chatManager.chatWith(JidCreate.entityBareFrom(endpoint.resolveParticipant(connection)));
         } else {
             // add the presence packet listener to the connection so we only get packets that concerns us
             // we must add the listener before creating the muc
diff --git a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
index baaed9c..8a5cdd6 100644
--- a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
+++ b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
@@ -234,6 +234,20 @@ public class XmppEndpoint extends DefaultEndpoint implements HeaderFilterStrateg
         return new XMPPTCPConnection(conf);
     }
 
+    /**
+     * If there is no "@" symbol in the participant, find the service domain
+     * JID and return the fully qualified JID for the participant as user@server.domain
+     */
+    public String resolveParticipant(XMPPConnection connection) {
+        String participant = getParticipant();
+        
+        if (participant.indexOf('@', 0) != -1) {
+            return participant;
+        }
+        
+        return participant + "@" + connection.getXMPPServiceDomain().toString();
+    }
+    
     /*
      * If there is no "@" symbol in the room, find the chat service JID and
      * return fully qualified JID for the room as room@conference.server.domain