NServiceBus.MsmqSubscriptionStorageQueue.TryReceiveById C# (CSharp) Method

TryReceiveById() public method

public TryReceiveById ( string messageId ) : void
messageId string
return void
        public void TryReceiveById(string messageId)
        {
            try
            {
                //Use of `None` here is intentional since ReceiveById works properly with this mode
                //for both transactional and non-transactional queues
                queue.ReceiveById(messageId, MessageQueueTransactionType.None);
            }
            catch (InvalidOperationException)
            {
                // thrown when message not found
            }
        }