summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java
index 541f47636f..08411dfdfe 100644
--- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java
+++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java
@@ -20,7 +20,10 @@ package org.apache.tuscany.sca.binding.jms.wire;
import java.util.List;
+import javax.jms.Destination;
import javax.jms.JMSException;
+import javax.jms.Queue;
+import javax.jms.Topic;
import org.apache.tuscany.sca.assembly.EndpointReference;
import org.apache.tuscany.sca.binding.jms.JMSBinding;
@@ -62,10 +65,17 @@ public class CallbackDestinationInterceptor implements Interceptor {
JMSBindingContext context = msg.getBindingContext();
javax.jms.Message jmsMsg = context.getJmsMsg();
+
if (service.getInterfaceContract().getCallbackInterface() != null) {
String callbackdestName = jmsMsg.getStringProperty(JMSBindingConstants.CALLBACK_Q_PROPERTY);
-
+ if (( callbackdestName == null) && ( jmsMsg.getJMSReplyTo() != null ) ) {
+ Destination replyTo = jmsMsg.getJMSReplyTo();
+ if (replyTo != null) {
+ callbackdestName = (replyTo instanceof Queue) ? ((Queue) replyTo).getQueueName() : ((Topic) replyTo).getTopicName();
+ }
+ }
+
if (callbackdestName != null) {
List<EndpointReference> refs = endpoint.getCallbackEndpointReferences();
for (EndpointReference ref : refs ) {
@@ -74,7 +84,7 @@ public class CallbackDestinationInterceptor implements Interceptor {
callbackBinding.setDestinationName(callbackdestName);
}
}
- }
+ }
String callbackID = jmsMsg.getStringProperty(JMSBindingConstants.CALLBACK_ID_PROPERTY);
if (callbackID != null) {