2009-07-11 Michael Barker <mike@middlesoft.co.uk>
[mono.git] / mcs / class / Mono.Messaging.RabbitMQ / Mono.Messaging.RabbitMQ / RabbitMQMessagingProvider.cs
index 45445659d0ee41ab743f4316069a2c4424d5ce26..90aaf7101a5bc2fea16a53781416ff040a2eba2e 100644 (file)
@@ -40,9 +40,8 @@ namespace Mono.Messaging.RabbitMQ {
 
        public class RabbitMQMessagingProvider : IMessagingProvider {
                
-               private volatile uint txCounter = 0;
+               private int txCounter = 0;
                private readonly uint localIp;
-               private static readonly string DEFAULT_REALM = "/data";
                
                public RabbitMQMessagingProvider()
                {
@@ -74,13 +73,14 @@ namespace Mono.Messaging.RabbitMQ {
                
                public IMessageQueueTransaction CreateMessageQueueTransaction ()
                {
-                       string txId = localIp.ToString () + (++txCounter).ToString (); 
+                       Interlocked.Increment (ref txCounter);
+                       string txId = localIp.ToString () + txCounter.ToString (); 
                        return new RabbitMQMessageQueueTransaction (txId);
                }
                
                public void DeleteQueue (QueueReference qRef)
                {
-                       RabbitMQMessageQueue.Delete (DEFAULT_REALM, qRef);
+                       RabbitMQMessageQueue.Delete (qRef);
                }
                
                private readonly IDictionary queues = new Hashtable ();