コード例 #1
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         _messageConsumer.Dispose();
     }
 }
コード例 #2
0
 public void Dispose()
 {
     _channelFactory.DeleteTopic();
     _channelFactory.DeleteQueue();
     _consumer.Dispose();
     _messageProducer.Dispose();
 }
コード例 #3
0
        public void When_a_message_is_sent_keep_order()
        {
            IAmAMessageConsumer consumer = _consumer;

            try
            {
                //Send a sequence of messages to Kafka
                var msgId  = SendMessage();
                var msgId2 = SendMessage();
                var msgId3 = SendMessage();
                var msgId4 = SendMessage();

                //Now read those messages in order

                var firstMessage = ConsumeMessages(consumer);
                var message      = firstMessage.First();
                message.Id.Should().Be(msgId);

                var secondMessage = ConsumeMessages(consumer);
                message = secondMessage.First();
                message.Id.Should().Be(msgId2);

                var thirdMessages = ConsumeMessages(consumer);
                message = thirdMessages.First();
                message.Id.Should().Be(msgId3);

                var fourthMessage = ConsumeMessages(consumer);
                message = fourthMessage.First();
                message.Id.Should().Be(msgId4);
            }
            finally
            {
                consumer?.Dispose();
            }
        }
コード例 #4
0
        public void When_queue_is_Purged()
        {
            IAmAMessageConsumer consumer = _consumer;

            try
            {
                //Send a sequence of messages to Kafka
                var msgId  = SendMessage();
                var msgId2 = SendMessage();
                var msgId3 = SendMessage();
                var msgId4 = SendMessage();

                //Now read those messages in order

                var firstMessage = ConsumeMessages(consumer);
                var message      = firstMessage.First();
                message.Id.Should().Be(msgId);

                _consumer.Purge();

                //Next Message should not exists (default will be returned)

                var nextMessage = ConsumeMessages(consumer);
                message = nextMessage.First();

                Assert.Equal(new Message(), message);
            }
            finally
            {
                consumer?.Dispose();
            }
        }
コード例 #5
0
        public void When_Disposing_Channel()
        {
            _channel.Dispose();

            //_should_call_dipose_on_messaging_gateway
            A.CallTo(() => _messageConsumer.Dispose()).MustHaveHappened();
        }
コード例 #6
0
 public void Dispose()
 {
     _producer?.Dispose();
     _consumer?.Dispose();
 }
 public void Dispose()
 {
     _sender.Dispose();
     _receiver.Dispose();
 }
コード例 #8
0
 public void Dispose()
 {
     _messageConsumer.Purge();
     _messageConsumer.Dispose();
 }
 public void Cleanup()
 {
     _receiver.Purge();
     _sender.Dispose();
     _receiver.Dispose();
 }
コード例 #10
0
 public void Dispose()
 {
     _messageProducer.Dispose();
     _messageConsumer.Dispose();
 }
コード例 #11
0
ファイル: InputChannel.cs プロジェクト: danbarua/Paramore
 void Dispose(bool disposing)
 {
     _messageConsumer.Dispose();
 }