To add a collaborator to this project you will need to use the Relish gem to add the collaborator via a terminal command. Soon you'll be able to also add collaborators here!
More about adding a collaboratorClient Acks
Support for doing client acks on messages
- Background
-
- Given
- I am connected to the broker
- And
- I have a destination :source_queue
- And
-
I have the following messages on :source_queue
body Test Message
- Scenarios
-
- Calling ack on the message to acknowledge it
- Calling nack on the message to put it back on the queue
- Acking in a transaction that commits
- Nacking in a transaction that commits
- Acking in a transaction that rolls back
- Nacking in a transaction that rolls back
- Calling ack on the message to acknowledge it
-
- When
-
I execute the following code
message = MessageDriver::Client.pop_message(:source_queue, client_ack: true) message.ack
- Then
- I expect to find no messages on :source_queue
- Calling nack on the message to put it back on the queue
-
- When
-
I execute the following code
message = MessageDriver::Client.pop_message(:source_queue, client_ack: true) message.nack
- Then
-
I expect to find the following message on :source_queue
body Test Message
- Acking in a transaction that commits
-
- When
-
I execute the following code
MessageDriver::Client.with_message_transaction do message = MessageDriver::Client.pop_message(:source_queue, client_ack: true) message.ack end
- Then
- I expect to find no messages on :source_queue
- Nacking in a transaction that commits
-
- When
-
I execute the following code
MessageDriver::Client.with_message_transaction do message = MessageDriver::Client.pop_message(:source_queue, client_ack: true) message.nack end
- Then
-
I expect to find the following message on :source_queue
body Test Message
- Acking in a transaction that rolls back
-
- When
-
I execute the following code
MessageDriver::Client.with_message_transaction do message = MessageDriver::Client.pop_message(:source_queue, client_ack: true) message.ack raise "rollback the transaction" end
- And
- I reset the context
- Then
- I expect it to raise "rollback the transaction"
- And
-
I expect to find the following message on :source_queue
body Test Message
- Nacking in a transaction that rolls back
-
- When
-
I execute the following code
MessageDriver::Client.with_message_transaction do message = MessageDriver::Client.pop_message(:source_queue, client_ack: true) message.nack raise "rollback the transaction" end
- And
- I reset the context
- Then
- I expect it to raise "rollback the transaction"
- And
-
I expect to find the following message on :source_queue
body Test Message
Last published about 6 years ago by soupmatt.