summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
index 1a175ce026..8695a760a1 100644
--- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
+++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
@@ -120,6 +120,7 @@ public class TransportServiceInterceptor implements Interceptor {
}
public Message invokeResponse(Message msg) {
+ JMSBindingContext context = msg.getBindingContext();
try {
//if operation is oneway, return back.
@@ -128,7 +129,6 @@ public class TransportServiceInterceptor implements Interceptor {
return msg;
}
- JMSBindingContext context = msg.getBindingContext();
Session session = context.getJmsResponseSession();
javax.jms.Message requestJMSMsg = context.getJmsMsg();
javax.jms.Message responseJMSMsg = msg.getBody();
@@ -173,12 +173,13 @@ public class TransportServiceInterceptor implements Interceptor {
producer.send((javax.jms.Message)msg.getBody());
producer.close();
- context.closeJmsResponseSession();
return msg;
} catch (JMSException e) {
throw new JMSBindingException(e);
+ } finally {
+ context.closeJmsResponseSession();
}
}