Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Information Provided
-
2.16.2
-
None
-
Advanced
Description
The use case uses a RabbitMQ InOut Producer with a dynamic RabbitMQ exchange name header :
from("direct:route") .setHeader(RabbitMQConstants.EXCHANGE_NAME, constant("exchange")) .inOut("rabbitmq:///?connectionFactory=...")
The exchange name is only set on header, not in RabbitMQ endpoint URI.
This generates a RabbitMQ Exception :
com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=403, reply-text=ACCESS_REFUSED - operation not permitted on the default exchange, class-id=50, method-id=20)
The problem is located when doing queueBinding on reply to queue in org.apache.camel.component.rabbitmq.reply.TemporaryQueueReplyManager
protected Connection createListenerContainer() throws Exception
channel.queueBind(getReplyTo(), endpoint.getExchangeName(), getReplyTo());
The header exchange name should be used instead of the endpoint exchange name.