-
Notifications
You must be signed in to change notification settings - Fork 44
Conversation
**Context:** [Publisher confirmations](https://www.rabbitmq.com/confirms.html#publisher-confirms), is a mechanism to ensure that a published message actually reached a broker. **How:** Extend, publisher configuration with two optional attributes: * `activate_confirmations` - when set to `true`, confirmations will be activated on the channel during publisher setup + confirmation will be awaited on every publish * `max_confirmation_wait_time` - maximum time in seconds, that publisher will wait for a confirmation from a broker before timeouting **Other:** * Move test publishers to a separate module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks promising!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need to fix this one failing test I have introduced for triggering confirmation timeouts.
test/support/test_publishers.ex
Outdated
exchange: "gen_rmq_out_exchange", | ||
uri: "amqp://guest:guest@localhost:5672", | ||
app_id: :my_app_id, | ||
activate_confirmations: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be enable_confirmations: true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! It makes me to realize that it is hard to test confirmations :/ Any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah. Only thing I can think of is to use a mock AMQP.Confirm.wait_for_confirms somehow. :\
Publisher confirmations, is a mechanism to ensure that a published message actually reached a broker.
How:
Extend publisher configuration with two optional attributes:
enable_confirmations
- when set totrue
, confirmations will be activated on the channel during publisher setup + confirmation will be awaited on every publishmax_confirmation_wait_time
- maximum time in milliseconds, that publisher will wait for a confirmation from a broker before timeoutingOther:
Description
Checklist