Support default exchange in consumer and publisher modules #213
Conversation
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 really nice @mkorszun 👍
@@ -4,11 +4,13 @@ defmodule GenRMQ.Binding do | |||
declaring consumer bindings and exchanges. | |||
""" | |||
|
|||
@type exchange :: String.t() | {exchange_kind(), String.t()} | |||
@type exchange :: String.t() | {exchange_kind(), String.t()} | :default |
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.
Can we add something that explains :default
in the documentation here as well? I think it would be the first place I would look.
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.
@vorce good point. Will update / extend the documentation.
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.
@vorce added some docs. Let me know if this is smth you had in mind.
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.
@mkorszun yes, perfect 👍
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 good to me!
880f5bd
to
131994e
Compare
As requested in https://github.com/meltwater/gen_rmq/issues/206, this PR introduces support for the default exchange in the publisher and consumer module.
Default Exchange
Implementation:
Whenever a publisher is configured with the default exchange, we need to ensure that such an exchange is not redeclared otherwise broker will return an error.
Whenever a consumer is configured with the default exchange, we need ensure that exchange is not redeclared and binding is not created (it already exists).
The default exchange is configured by providing
:default
atom as an exchange:Description
Checklist