camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject camel git commit: CAMEL-9995 Camel-JMS: includeAllJMSXProperties parameter doesn't work
Date Thu, 26 May 2016 13:28:23 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.17.x 3f9c21f8d -> 89f6906cf


CAMEL-9995 Camel-JMS: includeAllJMSXProperties parameter doesn't work


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/89f6906c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/89f6906c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/89f6906c

Branch: refs/heads/camel-2.17.x
Commit: 89f6906cfcb5e089dd44ac4a0c49ae759fc62a53
Parents: 3f9c21f
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Thu May 26 14:16:50 2016 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Thu May 26 15:26:59 2016 +0200

----------------------------------------------------------------------
 .../component/jms/JmsHeaderFilterStrategy.java    | 18 ++++++++++--------
 .../component/jms/JmsHeaderFilteringTest.java     |  4 ++--
 .../jms/JmsNotIncludeAllJMSXPropertiesTest.java   |  2 +-
 .../jms/jmsHeaderFilteringWithSpring.xml          |  8 ++++----
 4 files changed, 17 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/89f6906c/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsHeaderFilterStrategy.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsHeaderFilterStrategy.java
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsHeaderFilterStrategy.java
index 12c7f04..9bea7ed 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsHeaderFilterStrategy.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsHeaderFilterStrategy.java
@@ -36,14 +36,16 @@ public class JmsHeaderFilterStrategy extends DefaultHeaderFilterStrategy
{
     protected void initialize() {
         // ignore provider specified JMS extension headers see page 39 of JMS 1.1 specification
         // added "JMSXRecvTimestamp" as a workaround for an Oracle bug/typo in AqjmsMessage
-        getOutFilter().add("JMSXUserID");
-        getOutFilter().add("JMSXAppID");
-        getOutFilter().add("JMSXDeliveryCount");
-        getOutFilter().add("JMSXProducerTXID");
-        getOutFilter().add("JMSXConsumerTXID");
-        getOutFilter().add("JMSXRcvTimestamp");
-        getOutFilter().add("JMSXRecvTimestamp");
-        getOutFilter().add("JMSXState");
+        getInFilter().add("JMSXUserID");
+        getInFilter().add("JMSXGroupID");
+        getInFilter().add("JMSXAppID");
+        getInFilter().add("JMSXDeliveryCount");
+        getInFilter().add("JMSXProducerTXID");
+        getInFilter().add("JMSXConsumerTXID");
+        getInFilter().add("JMSXRcvTimestamp");
+        getInFilter().add("JMSXRecvTimestamp");
+        getInFilter().add("JMSXState");
+        getInFilter().add("JMSXGroupSeq");
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/89f6906c/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsHeaderFilteringTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsHeaderFilteringTest.java
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsHeaderFilteringTest.java
index 7f7bba4..826444e 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsHeaderFilteringTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsHeaderFilteringTest.java
@@ -52,7 +52,7 @@ public class JmsHeaderFilteringTest extends CamelTestSupport {
         MockEndpoint errors = this.resolveMandatoryEndpoint(assertionReceiver, MockEndpoint.class);
         errors.expectedMessageCount(0);
 
-        template.send(testQueueEndpointA, ExchangePattern.InOnly, new Processor() {
+        template.send(testQueueEndpointA + "?includeAllJMSXProperties=false", ExchangePattern.InOnly,
new Processor() {
             public void process(Exchange exchange) throws Exception {
                 exchange.getIn().setHeader("org.apache.camel.jms", 10000);
                 exchange.getIn().setHeader("org.apache.camel.test.jms", 20000);
@@ -119,7 +119,7 @@ public class JmsHeaderFilteringTest extends CamelTestSupport {
             assertEquals(20000, message.getJmsMessage().getObjectProperty("org_DOT_apache_DOT_camel_DOT_test_DOT_jms"));
 
             // should be filtered by default
-            assertNull(message.getJmsMessage().getStringProperty("JMSXAppID"));
+            assertNotNull(message.getJmsMessage().getStringProperty("JMSXAppID"));
 
             latch.countDown();
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/89f6906c/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsNotIncludeAllJMSXPropertiesTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsNotIncludeAllJMSXPropertiesTest.java
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsNotIncludeAllJMSXPropertiesTest.java
index 4bb8695..d5b508f 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsNotIncludeAllJMSXPropertiesTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsNotIncludeAllJMSXPropertiesTest.java
@@ -37,7 +37,7 @@ public class JmsNotIncludeAllJMSXPropertiesTest extends CamelTestSupport
{
     public void testNotIncludeAll() throws Exception {
         getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
         getMockEndpoint("mock:result").expectedHeaderReceived("foo", "bar");
-        getMockEndpoint("mock:result").expectedHeaderReceived("JMSXUserID", null);
+        getMockEndpoint("mock:result").expectedHeaderReceived("JMSXUserID", "Donald");
         getMockEndpoint("mock:result").expectedHeaderReceived("JMSXAppID", null);
 
         Map headers = new HashMap();

http://git-wip-us.apache.org/repos/asf/camel/blob/89f6906c/components/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsHeaderFilteringWithSpring.xml
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsHeaderFilteringWithSpring.xml
b/components/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsHeaderFilteringWithSpring.xml
index 064d363..b5d1e50 100644
--- a/components/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsHeaderFilteringWithSpring.xml
+++ b/components/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsHeaderFilteringWithSpring.xml
@@ -36,7 +36,7 @@
         <property name="headerFilterStrategy">
             <bean
                 class="org.apache.camel.component.jms.JmsHeaderFilterStrategy">
-                <property name="outFilter">
+                <property name="inFilter">
                     <set>
                         <value>JMSXUserID</value>
                         <value>JMSXAppID</value>
@@ -46,12 +46,12 @@
                         <value>JMSXRcvTimestamp</value>
                         <value>JMSXRecvTimestamp</value>
                         <value>JMSXState</value>
-                        <value>anotherheader</value>
+                        <value>testheader</value>
                     </set>
                 </property>
-                <property name="inFilter">
+                <property name="outFilter">
                     <set>
-                        <value>testheader</value>
+                        <value>anotherheader</value>
                     </set>
                 </property>
                 <property name="inFilterPattern" value="(org_apache_camel)[_|a-z|A-Z|0-9]*(test)[_|a-z|A-Z|0-9]*"/>
               


Mime
View raw message