activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r760527 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs
Date Tue, 31 Mar 2009 17:08:22 GMT
Author: jgomes
Date: Tue Mar 31 17:08:21 2009
New Revision: 760527

URL: http://svn.apache.org/viewvc?rev=760527&view=rev
Log:
Added destination checking when sending a message.  Informative exceptions will be thrown
if the destination is invalid.
Fixes [AMQNET-143]. (See https://issues.apache.org/activemq/browse/AMQNET-143)

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=760527&r1=760526&r2=760527&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
Tue Mar 31 17:08:21 2009
@@ -137,6 +137,19 @@
 
 		protected void Send(IDestination destination, IMessage message, bool persistent, byte priority,
TimeSpan timeToLive, bool specifiedTimeToLive)
 		{
+			if(null == destination)
+			{
+				// See if this producer was created without a destination.
+				if(null == info.Destination)
+				{
+					throw new NotSupportedException();
+				}
+
+				// The producer was created with a destination, but an invalid destination
+				// was specified.
+				throw new Apache.NMS.InvalidDestinationException();
+			}
+
 			CheckClosed();
 			ActiveMQMessage activeMessage = (ActiveMQMessage) message;
 



Mime
View raw message