-
Notifications
You must be signed in to change notification settings - Fork 1
Allow binding to multiple routing keys #4
Allow binding to multiple routing keys #4
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 good! I just pointed out some minor style issues.
@@ -75,7 +75,7 @@ object Amqp { | |||
*/ | |||
case class ChannelParameters(qos: Int, global: Boolean = false) | |||
|
|||
case class Binding(exchange: ExchangeParameters, queue: QueueParameters, routingKey: String) | |||
case class Binding(exchange: ExchangeParameters, queue: QueueParameters, routingKeys: Set[String]) |
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.
I think it's preferable to use varargs instead of a Set
here, as it will make the declaration of Binding
s simpler. The same applies to QueueBind
below.
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.
The approach discussed offline (re-ordering arguments) won't work because of the default argument value in:
case class QueueBind(queue: String, exchange: String, routingKeys: Set[String], args: Map[String, AnyRef] = Map.empty) extends Request
This:
case class QueueBind(queue: String, exchange: String, args: Map[String, AnyRef] = Map.empty, routingKeys: String*) extends Request
is not allowed.
I'm thinking it might be best to leave this as is. 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.
Let's leave it as is then.
Co-Authored-By: belerophon <thyandrecardoso@hotmail.com>
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.
LGTM
This should allow bindings to multiple routing keys, tackling sstone#68 and further working on sstone#73.