public RmqMessageProducerSendMessageTests()
        {
            _message = new Message(new MessageHeader(Guid.NewGuid(), "test1", MessageType.MT_COMMAND), 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);
        }
Example #2
0
        public RmqMessageConsumerMultipleTopicTests()
        {
            _messageTopic1 = new Message(new MessageHeader(Guid.NewGuid(), "test1", MessageType.MT_COMMAND), new MessageBody("test content for topic test 1"));
            _messageTopic2 = new Message(new MessageHeader(Guid.NewGuid(), "test2", MessageType.MT_COMMAND), new MessageBody("test content for topic test 2"));

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

            var topics = new[] { _messageTopic1.Header.Topic, _messageTopic2.Header.Topic };

            _messageProducer = new RmqMessageProducer(rmqConnection);
            _messageConsumer = new RmqMessageConsumer(rmqConnection, "Multiple.Topic.Queue", topics, false, 1, false);
            _messageConsumer.Purge();

            _client = new TestRMQListener(rmqConnection, "Multiple.Topic.Queue", topics);
        }
Example #3
0
        public RmqMessageProducerDelayedMessageTests()
        {
            var header          = new MessageHeader(Guid.NewGuid(), "test3", MessageType.MT_COMMAND);
            var originalMessage = new Message(header, new MessageBody("test3 content"));

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

            mutatedHeader.Bag.Add(HeaderNames.DELAY_MILLISECONDS, 1000);
            _message = new Message(mutatedHeader, 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);
        }