Ejemplo n.º 1
0
        private RemotingRequest BuildSendMessageRequest(Message message, int queueId, string routingKey)
        {
            var request = new SendMessageRequest {
                Message = message, QueueId = queueId, RoutingKey = routingKey
            };
            var data = MessageUtils.EncodeSendMessageRequest(request);

            return(new RemotingRequest((int)RequestCode.SendMessage, data));
        }
Ejemplo n.º 2
0
        private RemotingRequest BuildSendMessageRequest(Message message, int queueId)
        {
            var request = new SendMessageRequest {
                Message = message, QueueId = queueId
            };
            var data = MessageUtils.EncodeSendMessageRequest(request);

            if (data.Length > Setting.MessageMaxSize)
            {
                throw new Exception("Message size cannot exceed max message size:" + Setting.MessageMaxSize);
            }
            return(new RemotingRequest((int)RequestCode.SendMessage, data));
        }
Ejemplo n.º 3
0
        private RemotingRequest BuildSendMessageRequest(Message message, int queueId, BrokerConnection brokerConnection)
        {
            var request = new SendMessageRequest {
                Message = message, QueueId = queueId
            };

            request.Message.ProducerAddress = brokerConnection.RemotingClient.LocalEndPoint.ToAddress();
            var data = MessageUtils.EncodeSendMessageRequest(request);

            if (data.Length > Setting.MessageMaxSize)
            {
                throw new Exception("Message size cannot exceed max message size:" + Setting.MessageMaxSize);
            }
            return(new RemotingRequest((int)BrokerRequestCode.SendMessage, data));
        }