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

Add a consumerTag on the RabbitMQ camel endpoint

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.24.2
    • Fix Version/s: 3.2.0
    • Component/s: camel-rabbitmq
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      What do you think about adding a consumerTag to the Camel RabbitMQ endpoint ?

      The consumerTag allows you to specify a client-generated consumer tag to establish context when invoking channel.basicConsume(). This function is useful from an operational point of view to specialize the names of consumers in the RabbitMQ management console. See attachments.

      String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String, Object> arguments, Consumer callback) throws IOException;

      The evolution to realize is simple.

      1/ Add the consumerTag in the RabbitMQEndpoint class:

      @UriParam (label = "consumer")
      private String consumerTag = "";

      2/ Use the consumerTag in the RabbitConsumer class:

      @Override
      protected void doStart () throws Exception {
         if (channel == null) {
            throw new IOException ("The RabbitMQ channel is not open");
         }
         tag = channel.basicConsume (consumer.getEndpoint(). getQueue(), consumer.getEndpoint().isAutoAck(), consumer.getEndpoint().getConsumerTag(), false, consumer.getEndpoint().isExclusiveConsumer(), null, this);
       }

      NB : This functionnality exists on Spring AMQP through the org.springframework.amqp.support.ConsumerTagStrategy interface.

        Attachments

          Activity

            People

            • Assignee:
              acosentino Andrea Cosentino
              Reporter:
              Chotard Arnaud Chotard
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: