private void CreateQueueIfNotExists()
 {
     if (MsmqUtilities.QueueExists(storageAddress))
     {
         return;
     }
     MsmqUtilities.CreateQueue(storageAddress);
 }
Beispiel #2
0
        public void Initialize(EndpointAddress inputAddress, EndpointAddress errorAddress)
        {
            inputQueue = MsmqUtilities.GetQueue(inputAddress) ?? MsmqUtilities.CreateQueue(inputAddress);

            if (!MsmqUtilities.QueueExists(errorAddress))
            {
                MsmqUtilities.CreateQueue(errorAddress);
            }

            inputQueue.MessageReadPropertyFilter = new MessagePropertyFilter
            {
                Body          = true,
                Recoverable   = true,
                Id            = true,
                CorrelationId = true,
                Extension     = true,
                AppSpecific   = true,
            };

            inputQueue.ReceiveCompleted += OnReceiveCompleted;
            inputQueue.PeekCompleted    += OnPeekCompleted;
            inputQueue.BeginPeek();
        }