summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/binding-jms-runtime
diff options
context:
space:
mode:
authorbeckerdo <beckerdo@13f79535-47bb-0310-9956-ffa450edef68>2009-02-25 17:37:43 +0000
committerbeckerdo <beckerdo@13f79535-47bb-0310-9956-ffa450edef68>2009-02-25 17:37:43 +0000
commitb3716a99191639dc40db89b8c32a6909b799bc6e (patch)
tree29b81972508a3e1a3752295ef9b0df56a3d21efc /branches/sca-java-1.x/modules/binding-jms-runtime
parentfd31a1072875989d90434af4881d5020114e08d4 (diff)
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
Diffstat (limited to 'branches/sca-java-1.x/modules/binding-jms-runtime')
-rw-r--r--branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java15
-rw-r--r--branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java6
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());