public void Open()
        {
            if (this.ReceiveParameters.ReceiveContextSettings.Enabled)
            {
                Fx.Assert(this.receiver.Queue is MsmqSubqueueLockingQueue, "Queue must be MsmqSubqueueLockingQueue");
                this.lockQueueForReceive = ((MsmqSubqueueLockingQueue)this.receiver.Queue).LockQueueForReceive;
            }

            this.mainQueue        = this.receiver.Queue;
            this.mainQueueForMove = new MsmqQueue(this.mainQueueName, UnsafeNativeMethods.MQ_MOVE_ACCESS);
            // Open up the poison queue (for handling poison messages).
            this.poisonQueue       = new MsmqQueue(this.poisonQueueName, UnsafeNativeMethods.MQ_MOVE_ACCESS);
            this.retryQueueForMove = new MsmqQueue(this.retryQueueName, UnsafeNativeMethods.MQ_MOVE_ACCESS);
            this.retryQueueForPeek = new MsmqQueue(this.retryQueueName, UnsafeNativeMethods.MQ_RECEIVE_ACCESS);
            this.retryQueueMessage = new MsmqRetryQueueMessage();

            if (Thread.CurrentThread.IsThreadPoolThread)
            {
                StartPeek(this);
            }
            else
            {
                ActionItem.Schedule(Msmq4PoisonHandler.onStartPeek, this);
            }
        }
        public void Open()
        {
            if (this.ReceiveParameters.ReceiveContextSettings.Enabled)
            {
                Fx.Assert(this.receiver.Queue is MsmqSubqueueLockingQueue, "Queue must be MsmqSubqueueLockingQueue");
                this.lockQueueForReceive = ((MsmqSubqueueLockingQueue)this.receiver.Queue).LockQueueForReceive;
            }

            this.mainQueue = this.receiver.Queue;
            this.mainQueueForMove = new MsmqQueue(this.mainQueueName, UnsafeNativeMethods.MQ_MOVE_ACCESS);
            // Open up the poison queue (for handling poison messages).
            this.poisonQueue = new MsmqQueue(this.poisonQueueName, UnsafeNativeMethods.MQ_MOVE_ACCESS);
            this.retryQueueForMove = new MsmqQueue(this.retryQueueName, UnsafeNativeMethods.MQ_MOVE_ACCESS);
            this.retryQueueForPeek = new MsmqQueue(this.retryQueueName, UnsafeNativeMethods.MQ_RECEIVE_ACCESS);
            this.retryQueueMessage = new MsmqRetryQueueMessage();

            if (Thread.CurrentThread.IsThreadPoolThread)
            {
                StartPeek(this);
            }
            else
            {
                ActionItem.Schedule(Msmq4PoisonHandler.onStartPeek, this);
            }
        }
Пример #3
0
 public void Open()
 {
     if (this.ReceiveParameters.ReceiveContextSettings.Enabled)
     {
         this.lockQueueForReceive = ((MsmqSubqueueLockingQueue)this.receiver.Queue).LockQueueForReceive;
     }
     this.mainQueue         = this.receiver.Queue;
     this.mainQueueForMove  = new MsmqQueue(this.mainQueueName, 4);
     this.poisonQueue       = new MsmqQueue(this.poisonQueueName, 4);
     this.retryQueueForMove = new MsmqQueue(this.retryQueueName, 4);
     this.retryQueueForPeek = new MsmqQueue(this.retryQueueName, 1);
     this.retryQueueMessage = new MsmqRetryQueueMessage();
     if (Thread.CurrentThread.IsThreadPoolThread)
     {
         StartPeek(this);
     }
     else
     {
         ActionItem.Schedule(onStartPeek, this);
     }
 }
 public void Open()
 {
     if (this.ReceiveParameters.ReceiveContextSettings.Enabled)
     {
         this.lockQueueForReceive = ((MsmqSubqueueLockingQueue) this.receiver.Queue).LockQueueForReceive;
     }
     this.mainQueue = this.receiver.Queue;
     this.mainQueueForMove = new MsmqQueue(this.mainQueueName, 4);
     this.poisonQueue = new MsmqQueue(this.poisonQueueName, 4);
     this.retryQueueForMove = new MsmqQueue(this.retryQueueName, 4);
     this.retryQueueForPeek = new MsmqQueue(this.retryQueueName, 1);
     this.retryQueueMessage = new MsmqRetryQueueMessage();
     if (Thread.CurrentThread.IsThreadPoolThread)
     {
         StartPeek(this);
     }
     else
     {
         ActionItem.Schedule(onStartPeek, this);
     }
 }