private void Dispose(bool disposing) { if (disposing) { _messageConsumer.Dispose(); } }
public void Dispose() { _channelFactory.DeleteTopic(); _channelFactory.DeleteQueue(); _consumer.Dispose(); _messageProducer.Dispose(); }
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(); } }
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(); } }
public void When_Disposing_Channel() { _channel.Dispose(); //_should_call_dipose_on_messaging_gateway A.CallTo(() => _messageConsumer.Dispose()).MustHaveHappened(); }
public void Dispose() { _producer?.Dispose(); _consumer?.Dispose(); }
public void Dispose() { _sender.Dispose(); _receiver.Dispose(); }
public void Dispose() { _messageConsumer.Purge(); _messageConsumer.Dispose(); }
public void Cleanup() { _receiver.Purge(); _sender.Dispose(); _receiver.Dispose(); }
public void Dispose() { _messageProducer.Dispose(); _messageConsumer.Dispose(); }
void Dispose(bool disposing) { _messageConsumer.Dispose(); }