diff options
Diffstat (limited to 'branches/sca-java-1.x/modules/binding-jms-runtime')
2 files changed, 20 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java index 20ee4c8942..c3e6031b85 100644 --- a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java +++ b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java @@ -86,10 +86,23 @@ public class TransportReferenceInterceptor implements Interceptor { MessageProducer producer = session.createProducer(context.getRequestDestination()); + // Set JMS header attributes in producer, not message. + String opName = msg.getOperation().getName(); if (jmsBinding.getOperationJMSTimeToLive(msg.getOperation().getName()) != null) { producer.setTimeToLive(jmsBinding.getOperationJMSTimeToLive(msg.getOperation().getName())); } - + Integer priority = jmsBinding.getOperationJMSPriority( opName ); + if (priority != null) { + producer.setPriority(priority.intValue()); + } + Boolean deliveryModePersistent = jmsBinding.getOperationJMSDeliveryMode(opName); + if (deliveryModePersistent != null) { + if (deliveryModePersistent.booleanValue()) + producer.setDeliveryMode(javax.jms.DeliveryMode.PERSISTENT); + else + producer.setDeliveryMode(javax.jms.DeliveryMode.NON_PERSISTENT); + } + try { producer.send((javax.jms.Message)msg.getBody()); } finally { diff --git a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java index 7687b368b0..eebac3a8b7 100644 --- a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java +++ b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java @@ -153,6 +153,12 @@ public class TransportServiceInterceptor implements Interceptor { } MessageProducer producer = session.createProducer(replyDest); + + // Set jms header attributes in producer, not message. + int deliveryMode = requestJMSMsg.getJMSDeliveryMode(); + producer.setDeliveryMode(deliveryMode); + int deliveryPriority = requestJMSMsg.getJMSPriority(); + producer.setPriority(deliveryPriority); producer.send((javax.jms.Message)msg.getBody()); |