camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [camel] branch master updated: CAMEL-14229: STOMP headers are missing in the Exchange (#3369)
Date Mon, 02 Dec 2019 07:34:18 GMT
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 9020bf4  CAMEL-14229: STOMP headers are missing in the Exchange (#3369)
9020bf4 is described below

commit 9020bf4cd56a2b5aa8ef1082c171370fda9aeca3
Author: onlybytes <onlybytes@gmail.com>
AuthorDate: Mon Dec 2 13:03:54 2019 +0530

    CAMEL-14229: STOMP headers are missing in the Exchange (#3369)
    
    * CAMEL-14229: STOMP headers are missing in the Exchange
    
    * CAMEL-14229: STOMP headers are missing in the Exchange
---
 .../src/main/java/org/apache/camel/component/stomp/StompConsumer.java  | 2 ++
 .../src/main/java/org/apache/camel/component/stomp/StompEndpoint.java  | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompConsumer.java
b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompConsumer.java
index 144f8ee..b493f62 100644
--- a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompConsumer.java
+++ b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompConsumer.java
@@ -50,6 +50,8 @@ public class StompConsumer extends DefaultConsumer {
 
     void processExchange(Exchange exchange) {
         try {
+	    exchange.getIn().getHeaders().entrySet().removeIf(e -> getEndpoint().getHeaderFilterStrategy()
+		    .applyFilterToExternalHeaders(e.getKey(), e.getValue(), exchange));
             getProcessor().process(exchange);
         } catch (Throwable e) {
             exchange.setException(e);
diff --git a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
index 747ff3e9..8e55dbb 100644
--- a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
+++ b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompEndpoint.java
@@ -20,6 +20,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
 
 import org.apache.camel.AsyncCallback;
 import org.apache.camel.AsyncEndpoint;
@@ -124,6 +125,8 @@ public class StompEndpoint extends DefaultEndpoint implements AsyncEndpoint,
Hea
                         if (!consumers.isEmpty()) {
                             Exchange exchange = createExchange();
                             exchange.getIn().setBody(value.content());
+			    exchange.getIn().setHeaders(value.headerMap().entrySet().stream()
+			            .collect(Collectors.toMap(e -> e.getKey().toString(), Map.Entry::getValue)));
                             for (StompConsumer consumer : consumers) {
                                 consumer.processExchange(exchange);
                             }


Mime
View raw message