Example #1
0
        /// <summary>
        /// Removes a channel and all queues in it
        /// </summary>
        public async Task <TmqResponseCode> RemoveChannel(string channel, bool verifyResponse)
        {
            TmqMessage message = new TmqMessage();

            message.Type        = MessageType.Server;
            message.ContentType = KnownContentTypes.RemoveChannel;
            message.SetTarget(channel);
            message.ResponseRequired = verifyResponse;

            if (verifyResponse)
            {
                message.SetMessageId(UniqueIdGenerator.Create());
            }

            return(await WaitResponse(message, verifyResponse));
        }
Example #2
0
        /// <summary>
        /// Updates queue options
        /// </summary>
        public async Task <TmqResponseCode> SetQueueOptions(string channel, ushort queueId, Action <QueueOptions> optionsAction)
        {
            TmqMessage message = new TmqMessage();

            message.Type        = MessageType.Server;
            message.ContentType = KnownContentTypes.UpdateQueue;
            message.SetTarget(channel);
            message.ResponseRequired = true;
            message.SetMessageId(UniqueIdGenerator.Create());

            QueueOptions options = new QueueOptions();

            optionsAction(options);
            message.Content = new MemoryStream(Encoding.UTF8.GetBytes(options.Serialize(queueId)));

            return(await WaitResponse(message, true));
        }
Example #3
0
        /// <summary>
        /// Removes a queue in a channel in server
        /// </summary>
        public async Task <TmqResponseCode> RemoveQueue(string channel, ushort queueId, bool verifyResponse)
        {
            TmqMessage message = new TmqMessage();

            message.Type        = MessageType.Server;
            message.ContentType = KnownContentTypes.RemoveQueue;
            message.SetTarget(channel);
            message.ResponseRequired = verifyResponse;
            message.Content          = new MemoryStream(BitConverter.GetBytes(queueId));

            if (verifyResponse)
            {
                message.SetMessageId(UniqueIdGenerator.Create());
            }

            return(await WaitResponse(message, verifyResponse));
        }