From d0e8ca9ff2d81d6cd8eb48fc9c045ee5719243dd Mon Sep 17 00:00:00 2001 From: Sayre Blades Date: Tue, 15 Sep 2015 10:50:29 -0400 Subject: [PATCH] https://github.com/sstone/amqp-client/issues/66 --- src/main/scala/com/github/sstone/amqp/Amqp.scala | 3 +++ src/main/scala/com/github/sstone/amqp/ChannelOwner.scala | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/main/scala/com/github/sstone/amqp/Amqp.scala b/src/main/scala/com/github/sstone/amqp/Amqp.scala index 8ed385c..256f9f5 100644 --- a/src/main/scala/com/github/sstone/amqp/Amqp.scala +++ b/src/main/scala/com/github/sstone/amqp/Amqp.scala @@ -7,6 +7,7 @@ import akka.actor.{Actor, Props, ActorRef, ActorRefFactory} import akka.actor.FSM.{SubscribeTransitionCallBack, CurrentState, Transition} import java.util.concurrent.CountDownLatch + object Amqp { /** @@ -104,6 +105,8 @@ object Amqp { case class DeleteExchange(name: String, ifUnused: Boolean = false) extends Request + case class ExchangeBind(destination: String, source: String, routing_key: String, args: Map[String, AnyRef] = Map.empty) extends Request + case class QueueBind(queue: String, exchange: String, routing_key: String, args: Map[String, AnyRef] = Map.empty) extends Request case class QueueUnbind(queue: String, exchange: String, routing_key: String, args: Map[String, AnyRef] = Map.empty) extends Request diff --git a/src/main/scala/com/github/sstone/amqp/ChannelOwner.scala b/src/main/scala/com/github/sstone/amqp/ChannelOwner.scala index 15f22a5..73f9e34 100644 --- a/src/main/scala/com/github/sstone/amqp/ChannelOwner.scala +++ b/src/main/scala/com/github/sstone/amqp/ChannelOwner.scala @@ -89,6 +89,10 @@ object ChannelOwner { log.debug("binding queue {} to key {} on exchange {}", queue, routingKey, exchange) sender ! withChannel(channel, request)(c => c.queueBind(queue, exchange, routingKey, args)) } + case request@ExchangeBind(destination, source, routingKey, args) => { + log.debug("binding exchange {} to key {} on exchange {}", destination, routingKey, source) + sender ! withChannel(channel, request)(c => c.exchangeBind(destination, source, routingKey, args)) + } case request@QueueUnbind(queue, exchange, routingKey, args) => { log.debug("unbinding queue {} to key {} on exchange {}", queue, routingKey, exchange) sender ! withChannel(channel, request)(c => c.queueUnbind(queue, exchange, routingKey, args))