diff --git a/amqp-rpc.go b/amqp-rpc.go index 4959c93e2..b82f9cb64 100644 --- a/amqp-rpc.go +++ b/amqp-rpc.go @@ -24,7 +24,9 @@ import ( // XXX: I *think* these constants are appropriate. // We will probably want to tweak these in the future. const ( - AmqpExchange = "" + AmqpExchange = "boulder" + AmqpExchangeType = "topic" + AmqpInternal = false AmqpDurable = false AmqpDeleteUnused = false AmqpExclusive = false @@ -48,6 +50,18 @@ func amqpConnect(url string) (ch *amqp.Channel, err error) { // A simplified way to declare and subscribe to an AMQP queue func amqpSubscribe(ch *amqp.Channel, name string) (msgs <-chan amqp.Delivery, err error) { + err = ch.ExchangeDeclare( + AmqpExchange, + AmqpExchangeType, + AmqpDurable, + AmqpDeleteUnused, + AmqpInternal, + AmqpNoWait, + nil) + if err != nil { + log.Fatalf("Could not declare exchange: %s", err) + } + q, err := ch.QueueDeclare( name, AmqpDurable,