Esempio n. 1
0
        public RemotingResponse HandleRequest(IRequestHandlerContext context, RemotingRequest remotingRequest)
        {
            var request     = MessageUtils.DecodeSendMessageRequest(remotingRequest.Body);
            var storeResult = _messageService.StoreMessage(request.Message, request.QueueId, request.RoutingKey);

            _suspendedPullRequestManager.NotifyNewMessage(request.Message.Topic, storeResult.QueueId, storeResult.QueueOffset);
            var data = MessageUtils.EncodeMessageSendResponse(new SendMessageResponse(
                                                                  request.Message.Key,
                                                                  storeResult.MessageId,
                                                                  storeResult.MessageOffset,
                                                                  request.Message.Code,
                                                                  request.Message.Topic,
                                                                  request.QueueId,
                                                                  storeResult.QueueOffset));

            return(RemotingResponseFactory.CreateResponse(remotingRequest, data));
        }