From fcf920b0ab92dfab3bdb3c26843c044d4d193165 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 26 Jan 2012 16:25:28 +0000 Subject: Fix the two failing JMS compliance tests that set callback destiantions in the request message. I'm not sure if its whats intended after the recent callback changes but this gets the JMS compliance tests working git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1236275 13f79535-47bb-0310-9956-ffa450edef68 --- .../binding/jms/provider/RRBJMSBindingInvoker.java | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'sca-java-2.x/trunk/modules/binding-jms-runtime/src') 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; } -- cgit v1.2.3