Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9561

RabbitMQ InOut Producer generates operation not permitted on the default exchange when using dynamic exchange

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Information Provided
    • 2.16.2
    • Future
    • camel-rabbitmq
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            arnaudchotard Arnaud CHOTARD
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: