summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-jms-runtime
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-jms-runtime')
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java
index 6681870612..cafcd12cf2 100644
--- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java
+++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java
@@ -26,6 +26,7 @@ import javax.jms.Session;
import javax.naming.NamingException;
import org.apache.tuscany.sca.binding.jms.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.JMSBindingConstants;
import org.apache.tuscany.sca.binding.jms.JMSBindingException;
import org.apache.tuscany.sca.binding.jms.context.JMSBindingContext;
import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory;
@@ -110,10 +111,20 @@ public class TransportReferenceInterceptor implements Interceptor {
javax.jms.Message requestMessage = (javax.jms.Message)msg.getBody();
- String msgSelector = "JMSCorrelationID = '" +
- requestMessage.getJMSMessageID() +
- "'";
- MessageConsumer consumer = session.createConsumer(context.getReplyToDestination(), msgSelector);
+ String msgSelector = null;
+ String correlationScheme = jmsBinding.getCorrelationScheme();
+ if (correlationScheme == null || JMSBindingConstants.CORRELATE_MSG_ID.equalsIgnoreCase(correlationScheme)) {
+ msgSelector = "JMSCorrelationID = '" + requestMessage.getJMSMessageID() + "'";
+ } else if (JMSBindingConstants.CORRELATE_CORRELATION_ID.equalsIgnoreCase(correlationScheme)) {
+ msgSelector = "JMSCorrelationID = '" + requestMessage.getJMSCorrelationID() + "'";
+ }
+
+ MessageConsumer consumer;
+ if (msgSelector != null) {
+ consumer = session.createConsumer(context.getReplyToDestination(), msgSelector);
+ } else {
+ consumer = session.createConsumer(context.getReplyToDestination());
+ }
javax.jms.Message replyMsg;
try {