activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r1300419 - /activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageConsumer.cs
Date Tue, 13 Mar 2012 23:56:49 GMT
Author: jgomes
Date: Tue Mar 13 23:56:49 2012
New Revision: 1300419

URL: http://svn.apache.org/viewvc?rev=1300419&view=rev
Log:
Wait for message receive.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageConsumer.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageConsumer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageConsumer.cs?rev=1300419&r1=1300418&r2=1300419&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageConsumer.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageConsumer.cs Tue Mar
13 23:56:49 2012
@@ -42,6 +42,7 @@ namespace Apache.NMS.ZMQ
 		/// Context binding string
 		/// </summary>
 		private string contextBinding;
+		private Queue destination;
 		private event MessageListener listener;
 		private int listenerCount = 0;
 		private Thread asyncDeliveryThread = null;
@@ -73,6 +74,7 @@ namespace Apache.NMS.ZMQ
 			string clientId = session.Connection.ClientId;
 
 			this.contextBinding = session.Connection.BrokerUri.LocalPath;
+			this.destination = new Queue(this.contextBinding);
 			if(!string.IsNullOrEmpty(clientId))
 			{
 				this.messageSubscriber.StringToIdentity(clientId, Encoding.Unicode);
@@ -115,7 +117,7 @@ namespace Apache.NMS.ZMQ
 		public IMessage Receive()
 		{
 			// TODO: Support decoding of all message types + all meta data (e.g., headers and properties)
-			return ToNmsMessage(messageSubscriber.Recv(Encoding.ASCII, ZSendRecvOpt.NOBLOCK));
+			return ToNmsMessage(messageSubscriber.Recv(Encoding.ASCII, ZSendRecvOpt.NONE));
 		}
 
 		/// <summary>
@@ -248,7 +250,7 @@ namespace Apache.NMS.ZMQ
 			try
 			{
 				nmsMessage.NMSMessageId = "";
-				nmsMessage.NMSDestination = new Queue(contextBinding);
+				nmsMessage.NMSDestination = this.destination;
 				nmsMessage.NMSDeliveryMode = MsgDeliveryMode.NonPersistent;
 				nmsMessage.NMSPriority = MsgPriority.Normal;
 				nmsMessage.NMSTimestamp = DateTime.Now;



Mime
View raw message