jbrisbin / random-exchange

RabbitMQ exchange type for randomly selecting which queue to route to for load balancing.
42 stars 18 forks source link

Exchange type x-federation #8

Open tetherit opened 12 years ago

tetherit commented 12 years ago

What is the correct way to use an exchange type with an x- prefix, such as x-federation?

I'm trying to do:

exchange = AMQP::Exchange.new(channel, "x-federation", "my-exchange", :durable => true)

But I am getting this error from RabbitMQ:

connection <0.16597.1>, channel 2 - error:
{amqp_error,precondition_failed,
            "inequivalent arg 'type'for exchange 'xanview' in vhost '/': received none but current is the value 'topic' of type 'longstr'",
            'exchange.declare'}

Any ideas?

jbrisbin commented 12 years ago

Sorry for not seeing this issue sooner. Not sure why I'm not getting notified of these things...

It looks like your exchange is being re-declared with a different type, which is a no-no in the latest versions of RabbitMQ. It also looks like the Ruby client isn't passing the exchange type along correctly. Maybe it doesn't recognize "x-" types? Did you ask this on the RabbitMQ list?