diff options
-rw-r--r-- | sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java index 06a061cdd9..610be6cc56 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java @@ -266,19 +266,22 @@ public class RRBJMSBindingInvoker extends InterceptorAsyncImpl { } protected Destination getRequestDestination(org.apache.tuscany.sca.invocation.Message tuscanyMsg, Session session) throws JMSBindingException, NamingException, JMSException { - Destination requestDestination; -// if (!reference.isCallback()) { // TODO: 2.x migration, is this check needed? -// String toURI = tuscanyMsg.getTo().getURI(); -// if (toURI != null && toURI.startsWith("jms:")) { -// // the msg to uri contains the callback destination name -// // this is an jms physical name not a jndi name so need to use session.createQueue -// requestDestination = session.createQueue(toURI.substring(4)); -// } else { -// requestDestination = lookupDestination(); -// } -// } else { + Destination requestDestination = null; + + if (endpointReference.getReference().isForCallback()) { + + // Check if the CallbackDestinationInterceptor set a callback destination from the request msg + if (tuscanyMsg.getFrom().getTargetEndpoint() != null) { + if (tuscanyMsg.getFrom().getTargetEndpoint().getBinding() != null) { + this.jmsBinding = (JMSBinding)tuscanyMsg.getFrom().getTargetEndpoint().getBinding(); + requestDestination = lookupDestination(); + } + } + } + + if (requestDestination == null) { requestDestination = bindingRequestDest; -// } + } return requestDestination; } |