camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hekon...@apache.org
Subject git commit: Added JmsConstants.JMS_X_GROUP_ID constant.
Date Fri, 02 May 2014 09:13:11 GMT
Repository: camel
Updated Branches:
  refs/heads/master 34b347eaa -> 2d6736a5a


Added JmsConstants.JMS_X_GROUP_ID constant.


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

Branch: refs/heads/master
Commit: 2d6736a5a28540361e9611f020b2c2e074b6e296
Parents: 34b347e
Author: Henryk Konsek <hekonsek@gmail.com>
Authored: Fri May 2 11:12:50 2014 +0200
Committer: Henryk Konsek <hekonsek@gmail.com>
Committed: Fri May 2 11:12:50 2014 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/jms/JmsBinding.java   | 3 ++-
 .../main/java/org/apache/camel/component/jms/JmsConstants.java | 1 +
 .../camel/component/jms/JmsProducerWithJMSHeaderTest.java      | 5 +++--
 .../apache/camel/component/jms/JmsRouteUsingJMSXGroupTest.java | 6 ++++--
 4 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2d6736a5/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
index b86e362..3a2f3e1 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
@@ -57,6 +57,7 @@ import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.camel.component.jms.JmsConstants.JMS_X_GROUP_ID;
 import static org.apache.camel.component.jms.JmsMessageHelper.normalizeDestinationName;
 import static org.apache.camel.component.jms.JmsMessageType.Bytes;
 import static org.apache.camel.component.jms.JmsMessageType.Map;
@@ -169,7 +170,7 @@ public class JmsBinding {
                 map.put("JMSType", JmsMessageHelper.getJMSType(jmsMessage));
 
                 // this works around a bug in the ActiveMQ property handling
-                map.put("JMSXGroupID", jmsMessage.getStringProperty("JMSXGroupID"));
+                map.put(JMS_X_GROUP_ID, jmsMessage.getStringProperty(JMS_X_GROUP_ID));
                 map.put("JMSXUserID", jmsMessage.getStringProperty("JMSXUserID"));
             } catch (JMSException e) {
                 throw new RuntimeCamelException(e);

http://git-wip-us.apache.org/repos/asf/camel/blob/2d6736a5/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConstants.java
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConstants.java
index a4f7b23..3b20026 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConstants.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConstants.java
@@ -23,6 +23,7 @@ public final class JmsConstants {
 
     public static final String JMS_DESTINATION = "CamelJmsDestination";
     public static final String JMS_DESTINATION_NAME = "CamelJmsDestinationName";
+    public static final String JMS_X_GROUP_ID = "JMSXGroupID";
     public static final String JMS_MESSAGE_TYPE = "CamelJmsMessageType";
     public static final String JMS_DELIVERY_MODE = "CamelJmsDeliveryMode";
     public static final String JMS_REQUEST_TIMEOUT = "CamelJmsRequestTimeout";

http://git-wip-us.apache.org/repos/asf/camel/blob/2d6736a5/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsProducerWithJMSHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsProducerWithJMSHeaderTest.java
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsProducerWithJMSHeaderTest.java
index 52b430b..d995c2d 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsProducerWithJMSHeaderTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsProducerWithJMSHeaderTest.java
@@ -31,6 +31,7 @@ import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 import static org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge;
+import static org.apache.camel.component.jms.JmsConstants.JMS_X_GROUP_ID;
 
 /**
  * @version 
@@ -213,9 +214,9 @@ public class JmsProducerWithJMSHeaderTest extends CamelTestSupport {
     public void testInOnlyJMSXGroupID() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
-        mock.message(0).header("JMSXGroupID").isEqualTo("atom");
+        mock.message(0).header(JMS_X_GROUP_ID).isEqualTo("atom");
 
-        template.sendBodyAndHeader("activemq:queue:foo", "Hello World", "JMSXGroupID", "atom");
+        template.sendBodyAndHeader("activemq:queue:foo", "Hello World", JMS_X_GROUP_ID, "atom");
 
         assertMockEndpointsSatisfied();
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/2d6736a5/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingJMSXGroupTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingJMSXGroupTest.java
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingJMSXGroupTest.java
index 4a4398e..d310aef 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingJMSXGroupTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingJMSXGroupTest.java
@@ -27,6 +27,8 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import static org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge;
+import static org.apache.camel.component.jms.JmsConstants.JMS_X_GROUP_ID;
+
 /**
  * @version 
  */
@@ -51,8 +53,8 @@ public class JmsRouteUsingJMSXGroupTest extends CamelTestSupport {
             final int index = i;
             executor.submit(new Callable<Object>() {
                 public Object call() throws Exception {
-                    template.sendBodyAndHeader("direct:start", "IBM: " + index, "JMSXGroupID",
"IBM");
-                    template.sendBodyAndHeader("direct:start", "SUN: " + index, "JMSXGroupID",
"SUN");
+                    template.sendBodyAndHeader("direct:start", "IBM: " + index, JMS_X_GROUP_ID,
"IBM");
+                    template.sendBodyAndHeader("direct:start", "SUN: " + index, JMS_X_GROUP_ID,
"SUN");
 
                     return null;
                 }


Mime
View raw message