コード例 #1
0
        public void Establish()
        {
            _message = new Message(header: new MessageHeader(Guid.NewGuid(), "test1", MessageType.MT_COMMAND), body: new MessageBody("test content"));

            var rmqConnection = new RmqMessagingGatewayConnection
            {
                AmpqUri  = new AmqpUriSpecification(new Uri("amqp://*****:*****@localhost:5672/%2f")),
                Exchange = new Exchange("paramore.brighter.exchange")
            };

            _messageProducer = new RmqMessageProducer(rmqConnection);
            _messageConsumer = new RmqMessageConsumer(rmqConnection, _message.Header.Topic, _message.Header.Topic, false, 1, false);
            _messageConsumer.Purge();

            _client = new TestRMQListener(rmqConnection, _message.Header.Topic);
        }
コード例 #2
0
        public void Establish()
        {
            var header          = new MessageHeader(Guid.NewGuid(), "test3", MessageType.MT_COMMAND);
            var originalMessage = new Message(header: header, body: new MessageBody("test3 content"));

            var mutatedHeader = new MessageHeader(header.Id, "test3", MessageType.MT_COMMAND);

            mutatedHeader.Bag.Add(HeaderNames.DELAY_MILLISECONDS, 1000);
            _message = new Message(header: mutatedHeader, body: originalMessage.Body);

            var rmqConnection = new RmqMessagingGatewayConnection
            {
                AmpqUri  = new AmqpUriSpecification(new Uri("amqp://*****:*****@localhost:5672/%2f")),
                Exchange = new Exchange("paramore.brighter.exchange", supportDelay: true)
            };

            _messageProducer = new RmqMessageProducer(rmqConnection);
            _messageConsumer = new RmqMessageConsumer(rmqConnection, _message.Header.Topic, _message.Header.Topic, false, 1, false);
            _messageConsumer.Purge();

            _client = new TestRMQListener(rmqConnection, _message.Header.Topic);
        }