Exemple #1
0
        internal NetStream ExecRequset(QueueMessage request)
        {
            switch (request.Command)
            {
            case QueueCmd.Abort:

                break;

            case QueueCmd.AddQueue:
                MQueue mq = null;
                return(QueueMessage.DoAck(AddQueue(QProperties.Get(request.Headers), out mq), null));

            case QueueCmd.Commit:
                break;

            case QueueCmd.Dequeue:
            case QueueCmd.DequeueItem:
            case QueueCmd.DequeuePriority:
            case QueueCmd.Peek:
            case QueueCmd.PeekItem:
            case QueueCmd.PeekPriority:
                return(QueueMessage.DoResponse(ExecGet(request)));

            case QueueCmd.Enqueue:
                return(QueueMessage.DoAck(ExecSet(request), null));

            case QueueCmd.Exists:
                return(QueueMessage.DoAck(Exists(request.Host), null));

            case QueueCmd.QueueProperty:
                break;

            case QueueCmd.RemoveQueue:
                return(QueueMessage.DoAck(RemoveQueue(request.Host), null));

            //case QueueCmd.ReportQueueItems:
            //    GetQueueItems(message.GetHostName());
            //    break;
            //case QueueCmd.ReportQueueItemsTable:
            //    GetQueueItemsTable(message.GetHostName());
            //    break;
            case QueueCmd.ReportQueueList:
                GetQueueList();
                break;
            }

            return(null);
        }
Exemple #2
0
        /// <summary>
        /// Enqueue message <see cref=""/> to queue.
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        /// <exception cref="KeyNotFoundException"></exception>
        /// <exception cref="ArgumentException"></exception>
        /// <exception cref="SerializationException"></exception>
        /// <exception cref="Exception"></exception>
        public NetStream Enqueue(QueueMessage request)
        {
            var state = ExecSet(request);

            return(QueueMessage.DoAck(state, null));// BinarySerializer.SerializeToStream((int)ExecSet(message));
        }