0
votes

I am migrating from Camel 2 to Camel 3 and I'm eager to use the Endpoint DSL described here, however I'm running into an issue when migrating my endpoints.

I used to have a route writing to a RabbitMQ queue like this:

.toD("rabbitmq:$vhost?connectionFactory=#customConnectionFactory&queue=$responseQueueName&autoDelete=false&routingKey=$responseQueueName&bridgeEndpoint=true")

Which I migrated to

.toD(
    rabbitmq(vhost)
    .connectionFactory(connectionFactory)
    .queue(responseQueueName)
    .autoDelete(false)
    .routingKey(responseQueueName)
    .bridgeEndpoint(true)

However, when creating the endpoint, Camel also adds a hash parameter that cannot be set to the endpoint, resulting in the following exception:

Failed to resolve endpoint: rabbitmq://MYVHOST?autoDelete=false&bridgeEndpoint=true&hash=753a744c&queue=MYQUEUENAME&routingKey=MYQUEUENAME due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{hash=753a744c}]

My endpoint syntax is correct, AFAIK, because I'm using an endpoint created the same way in the from clause of my route.

1
Looks like a bug, you are welcome to create Jira issue. As a workaround you can use .connectionFactory("#customConnectionFactory")Bedla
The issue is not with the connection factory itself, but rather with toD not accepting the hash parameter.Raibaz
Ah yeah looks like its when you refer to an connection factory instance then the uri builder generates this via a hash placeholderClaus Ibsen
Thanks I have reproduced the issue and logged a bug: issues.apache.org/jira/browse/CAMEL-14306Claus Ibsen

1 Answers

0
votes

Turns out the issue was in the output endpoint being specified with toD, switching it to a regular to solved the issue.