Logo: Relish

  1. Sign in

Project: Message-driver 0.7

Publisher Acknowledgements

  • @bunny

RabbitMQ supports confirmation of published messages
See http://www.rabbitmq.com/confirms.html for details.

Verifying the publish of a single message and of a group of messages is
supported as described below.

Background
Given
I am connected to the broker
And
I have a destination :publish_ack with no messages on it
Scenarios
Publishing a single message with confirmations turned on
When
I execute the following code
publish(:publish_ack, "Test Message", {}, confirm: true)
Then
I expect all the publishes to have been acknowledged
And
I expect to find the following message on :publish_ack
body
Test Message
Publishing a single message where confirmations are turned on by the destination
When
I execute the following code
my_new_destination = MessageDriver::Client.dynamic_destination(:publish_ack, {}, {confirm: true})
my_new_destination.publish("Test Message")
Then
I expect all the publishes to have been acknowledged
And
I expect to find the following message on :publish_ack
body
Test Message
Publishing a batch of messages with confirmations turned on
When
I execute the following code
with_message_transaction(type: :confirm_and_wait) do
  50.times do |i|
    publish(:publish_ack, "Test Message #{i}")
  end
end
Then
I expect all the publishes to have been acknowledged
And
I expect that we are not in transaction mode
And
I expect to find 50 messages on :publish_ack

Last published over 3 years ago by soupmatt.