Dear community,
I'm writing an exploratory prototype with Camel (version 2.13.2) and RabbitMQ (version 3.2.4) and I have problems connecting a camel consumer to a pre-provisionned queue.
My RabbitMQ instance is up and running, and I have declared the following:
rabbitmqadmin -u admin -p xxx declare queue name=qbsi auto_delete=true durable=true
rabbitmqadmin -u admin -p xxx declare exchange name=xbsi durable=true type=direct
rabbitmqadmin -u admin -p xxx declare binding source=xbsi destination_type=queue routing_key=bsi destination=qbsi
and sent one message to the qbsi queue
here's the RabbitMQ info about the queues and exchanges:
rabbitmqadmin -u admin -p xxx list queues
+-------+------+-------------+-----------+---------+------------------------+---------------------+--------+----------+----------------+-------------------------+---------------------+--------+---------+
| vhost | name | auto_delete | consumers | durable | exclusive_consumer_tag | idle_since | memory | messages | messages_ready | messages_unacknowledged | node | policy | status |
+-------+------+-------------+-----------+---------+------------------------+---------------------+--------+----------+----------------+-------------------------+---------------------+--------+---------+
| / | qbsi | True | 0 | True | | 2014-09-09 16:17:22 | 21792 | 1 | 1 | 0 | rabbit@c31b433c9c78 | | running |
+-------+------+-------------+-----------+---------+------------------------+---------------------+--------+----------+----------------+-------------------------+---------------------+--------+---------+
rabbitmqadmin -u admin -p xxx list exchanges
+-------+--------------------+---------+-------------+---------+----------+
| vhost | name | type | auto_delete | durable | internal |
+-------+--------------------+---------+-------------+---------+----------+
...
| / | xbsi | direct | False | True | False |
+-------+--------------------+---------+-------------+---------+----------+
rabbitmqadmin -u admin -p xxx list bindings
+-------+--------+-------------+------------------+-------------+----------------+
| vhost | source | destination | destination_type | routing_key | properties_key |
+-------+--------+-------------+------------------+-------------+----------------+
| / | | qbsi | queue | qbsi | qbsi |
| / | xbsi | qbsi | queue | bsi | bsi |
+-------+--------+-------------+------------------+-------------+----------------+
I then launch my Camel consumer client with the following URI:
rabbitmq://localhost/xbsi?queue=qbsi&username=admin&password=xxx&autoDelete=false
The consumer connects to RabbitMQ (visible in the "connections" tab of the console) but does not consume any message.
After a 5 minutes timeout, I get the following exception:
java.io.IOException
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106)
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:124)
at com.rabbitmq.client.impl.ChannelN.queueDeclare(ChannelN.java:779)
at com.rabbitmq.client.impl.ChannelN.queueDeclare(ChannelN.java:61)
at org.apache.camel.component.rabbitmq.RabbitMQConsumer.doStart(RabbitMQConsumer.java:63)
...
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - parameters for queue 'qbsi' in vhost '/' not equivalent, class-id=50, method-id=10)
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67)
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33)
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:343)
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:216)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:118)
I have tried a few more URI combinations, like setting autoDelete=true in case it was refering to the queue rather than the exchange, or specifying routingKey=bsi&exchangeType=direct&durable=true
but I can't seem to find a working combination of parameters.
Any idea of what I'm doing wrong?
Thanks