servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gra...@apache.org
Subject svn commit: r474184 - in /incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms: ./ jca/ multiplexing/ standard/
Date Mon, 13 Nov 2006 08:06:22 GMT
Author: grantm
Date: Mon Nov 13 00:06:18 2006
New Revision: 474184

URL: http://svn.apache.org/viewvc?view=rev&rev=474184
Log:
SM-744: added XBean configuration option to jms endpoint to allow for using the JMS request
message id as the JMS correlation id. Patch provided by Martin Landua

Modified:
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsEndpoint.java
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/jca/JcaConsumerProcessor.java
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/multiplexing/MultiplexingConsumerProcessor.java
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java

Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsEndpoint.java?view=diff&rev=474184&r1=474183&r2=474184
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsEndpoint.java
(original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsEndpoint.java
Mon Nov 13 00:06:18 2006
@@ -56,6 +56,8 @@
     protected String jndiConnectionFactoryName;
     protected String jndiDestinationName;
     protected String jmsProviderDestinationName;
+    
+    protected boolean useMsgIdInResponse;
     //
     // Spring configuration
     //
@@ -458,4 +460,17 @@
         return component.getKeystoreManager();
     }
 
-}
\ No newline at end of file
+    /**
+     * Determines whether for a request/response pattern, the message id of the request message
+     * should be used as the correlation id in the response or the correlation id of the
request.
+     * @return
+     */
+    public boolean isUseMsgIdInResponse() {
+        return useMsgIdInResponse;
+    }
+
+    public void setUseMsgIdInResponse(boolean useMsgIdInResponse) {
+        this.useMsgIdInResponse = useMsgIdInResponse;
+    }
+
+}

Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/jca/JcaConsumerProcessor.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/jca/JcaConsumerProcessor.java?view=diff&rev=474184&r1=474183&r2=474184
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/jca/JcaConsumerProcessor.java
(original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/jca/JcaConsumerProcessor.java
Mon Nov 13 00:06:18 2006
@@ -138,7 +138,11 @@
             response = fromNMSResponse(exchange, context, session);
             if (response != null) {
                 MessageProducer producer = session.createProducer(message.getJMSReplyTo());
-                response.setJMSCorrelationID(message.getJMSCorrelationID());
+                if (endpoint.isUseMsgIdInResponse()) {
+                    response.setJMSCorrelationID(message.getJMSMessageID());
+                } else {
+                    response.setJMSCorrelationID(message.getJMSCorrelationID());
+                }
                 producer.send(response);
             }
         } finally {

Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/multiplexing/MultiplexingConsumerProcessor.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/multiplexing/MultiplexingConsumerProcessor.java?view=diff&rev=474184&r1=474183&r2=474184
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/multiplexing/MultiplexingConsumerProcessor.java
(original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/multiplexing/MultiplexingConsumerProcessor.java
Mon Nov 13 00:06:18 2006
@@ -109,7 +109,11 @@
             response = fromNMSResponse(exchange, context, session);
             if (response != null) {
                 producer = session.createProducer(message.getJMSReplyTo());
-                response.setJMSCorrelationID(message.getJMSCorrelationID());
+                if (endpoint.isUseMsgIdInResponse()) {
+                    response.setJMSCorrelationID(message.getJMSMessageID());
+                } else {
+                    response.setJMSCorrelationID(message.getJMSCorrelationID());
+                }
                 producer.send(response);
             }
         } finally {

Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java?view=diff&rev=474184&r1=474183&r2=474184
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java
(original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java
Mon Nov 13 00:06:18 2006
@@ -123,7 +123,11 @@
                 response = fromNMSResponse(exchange, context, session);
                 if (response != null) {
                     producer = session.createProducer(message.getJMSReplyTo());
-                    response.setJMSCorrelationID(message.getJMSCorrelationID());
+                    if (endpoint.isUseMsgIdInResponse()) {
+                        response.setJMSCorrelationID(message.getJMSMessageID());
+                    } else {
+                        response.setJMSCorrelationID(message.getJMSCorrelationID());
+                    }
                     producer.send(response);
                 }
             } finally {



Mime
View raw message