You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/12/14 22:44:23 UTC
svn commit: r890492 -
/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs
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;