public void CheckAvailabilityOfQueue(QueueName queue)
        {
            var userName = WindowsIdentity.GetCurrent().Name;

            if (!MessageQueue.Exists(queue.GetQueueLocalName()))
            {
                MessageQueue.Create(queue.GetQueueLocalName(), true); // transactional
                MsmqPermissionManager.SetPermissionsForQueue(queue.GetQueueLocalName(), userName, _configuration.Name);
            }
            else
            {
                MsmqPermissionManager.SetPermissionsForQueue(queue.GetQueueLocalName(), userName, _configuration.Name);
            }
        }
        private void SetPermissions(MessageQueue queue)
        {
            var userName = WindowsIdentity.GetCurrent().Name;

            MsmqPermissionManager.SetPermissionsForQueue(queue, userName);
        }