You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by tushmish <tu...@yahoo.co.in> on 2013/08/27 06:51:00 UTC
Camel RabbitMQ from 2.12 snapshot - missing parameter type:direct
Hi,
I am trying to use RabbitMQ component from Camel 2.12 Snapshot. I am trying
to read messages from queue into camel exchange.
Route definition
<route id="getMessageFromBroker">
<from
uri="rabbitmq://localhost:5672/myExchange?durable=true&queue=myQueue&username=guest&password=guest&routingKey=aaa"/>
<bean ref="rabbitMQProcessor"
method="getMessageFromBroker(org.apache.camel.Exchange)"/>
<to uri="http4://in.yahoo.com"/>
</route>
getMessageFromBroker -> where the message body is read.
In RabbitMQ - using Web Management console,
Exchange - myExchange has been created. with type = direct, durable = true.
Queue - myQueue has been created and binded to myexchange with routingKey =
aaa.
However, on loading the camel context, I get this error.
channel error; reason: {#method<channel.close>(reply-code=406,
reply-text=PRECONDITION_FAILED - cannot redeclare exchange 'myExchange' in
vhost '/' with different type, durable, internal or autodelete value,
class-id=40, method-id=10), null, ""}
The error is self explicable. But I am not redeclaring myExchange here. I
looked at the Options section here - http://camel.apache.org/rabbitmq.html.
But I do not find an option for 'type'. May this be the problem ?
What am I missing ?
Thanks for your time.
Tushar
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-RabbitMQ-from-2-12-snapshot-missing-parameter-type-direct-tp5738013.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel RabbitMQ from 2.12 snapshot - missing parameter
type:direct
Posted by tushmish <tu...@yahoo.co.in>.
Hi Willem,
Thanks for your quick reply.
Thanks,
Tushar
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-RabbitMQ-from-2-12-snapshot-missing-parameter-type-direct-tp5738013p5738026.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel RabbitMQ from 2.12 snapshot - missing parameter
type:direct
Posted by Willem jiang <wi...@gmail.com>.
Hi
Camel RabbitMQ doesn't support to set the type currently.
The type value is direct, with the code like this:
channel.exchangeDeclare(endpoint.getExchangeName(),
"direct",
endpoint.isDurable(),
endpoint.isAutoDelete(),
new HashMap<String, Object>());
I just found the below code doesn't follow the configuration of endpoint
hannel.queueDeclare(endpoint.getQueue(), true, false, false, null);
That is reason which causes the channel was closed.
I just updated the code, and push it into git central repo, please check it out to verify the fix.
--
Willem Jiang
Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On Tuesday, August 27, 2013 at 12:51 PM, tushmish wrote:
> Hi,
>
> I am trying to use RabbitMQ component from Camel 2.12 Snapshot. I am trying
> to read messages from queue into camel exchange.
>
> Route definition
>
> <route id="getMessageFromBroker">
> <from
> uri="rabbitmq://localhost:5672/myExchange?durable=true&queue=myQueue&username=guest&password=guest&routingKey=aaa"/>
> <bean ref="rabbitMQProcessor"
> method="getMessageFromBroker(org.apache.camel.Exchange)"/>
> <to uri="http4://in.yahoo.com (http://in.yahoo.com)"/>
> </route>
>
> getMessageFromBroker -> where the message body is read.
>
> In RabbitMQ - using Web Management console,
> Exchange - myExchange has been created. with type = direct, durable = true.
> Queue - myQueue has been created and binded to myexchange with routingKey =
> aaa.
>
> However, on loading the camel context, I get this error.
> channel error; reason: {#method<channel.close>(reply-code=406,
> reply-text=PRECONDITION_FAILED - cannot redeclare exchange 'myExchange' in
> vhost '/' with different type, durable, internal or autodelete value,
> class-id=40, method-id=10), null, ""}
>
> The error is self explicable. But I am not redeclaring myExchange here. I
> looked at the Options section here - http://camel.apache.org/rabbitmq.html.
> But I do not find an option for 'type'. May this be the problem ?
>
> What am I missing ?
>
> Thanks for your time.
>
> Tushar
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-RabbitMQ-from-2-12-snapshot-missing-parameter-type-direct-tp5738013.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).