activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r890492 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs
Date Mon, 14 Dec 2009 21:44:23 GMT
Author: tabish
Date: Mon Dec 14 21:44:22 2009
New Revision: 890492

URL: http://svn.apache.org/viewvc?rev=890492&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQNET-223

Update MessageProducer to properly check the value of the default destination and not allow
a client to perform a send to a destination that is not the default if one was set.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs?rev=890492&r1=890491&r2=890492&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs
Mon Dec 14 21:44:22 2009
@@ -171,10 +171,25 @@
                 throw new Apache.NMS.InvalidDestinationException();
             }
 
+            ActiveMQDestination dest = null;
+
+            if(destination == this.info.Destination)
+            {
+                dest = destination as ActiveMQDestination;
+            }
+            else if(info.Destination == null)
+            {
+                dest = ActiveMQDestination.Transform(destination);
+            }
+            else
+            {
+                throw new NotSupportedException("This producer can only send messages to:
" + this.info.Destination.PhysicalName);
+            }
+
             ActiveMQMessage activeMessage = (ActiveMQMessage) message;
 
             activeMessage.ProducerId = info.ProducerId;
-            activeMessage.FromDestination = destination;
+            activeMessage.Destination = dest;
             activeMessage.NMSDeliveryMode = deliveryMode;
             activeMessage.NMSPriority = priority;
 



Mime
View raw message