You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andrea Cosentino (Jira)" <ji...@apache.org> on 2020/01/18 11:58:00 UTC

[jira] [Assigned] (CAMEL-14407) Add a consumerTag on the RabbitMQ camel endpoint

     [ https://issues.apache.org/jira/browse/CAMEL-14407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Cosentino reassigned CAMEL-14407:
----------------------------------------

    Assignee: Andrea Cosentino

> Add a consumerTag on the RabbitMQ camel endpoint
> ------------------------------------------------
>
>                 Key: CAMEL-14407
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14407
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-rabbitmq
>    Affects Versions: 2.24.2
>            Reporter: Arnaud Chotard
>            Assignee: Andrea Cosentino
>            Priority: Major
>             Fix For: 3.1.0
>
>         Attachments: 2020-01-15 16_40_28-RabbitMQ Management.png
>
>
> 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.
> {code:java}
> String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String, Object> arguments, Consumer callback) throws IOException;{code}
> The evolution to realize is simple.
> 1/ Add the consumerTag in the RabbitMQEndpoint class:
> {code:java}
> @UriParam (label = "consumer")
> private String consumerTag = "";{code}
> 2/ Use the consumerTag in the RabbitConsumer class:
> {code:java}
> @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);
>  }{code}
> NB : This functionnality exists on Spring AMQP through the org.springframework.amqp.support.ConsumerTagStrategy interface.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)