From b3716a99191639dc40db89b8c32a6909b799bc6e Mon Sep 17 00:00:00 2001 From: beckerdo Date: Wed, 25 Feb 2009 17:37:43 +0000 Subject: TUSCANY-2857 Correct handling of JMSDeliveryMode and JMSPriority git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@747867 13f79535-47bb-0310-9956-ffa450edef68 --- .../jms/transport/TransportReferenceInterceptor.java | 15 ++++++++++++++- .../jms/transport/TransportServiceInterceptor.java | 6 ++++++ 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'branches/sca-java-1.x/modules/binding-jms-runtime') 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()); -- cgit v1.2.3