camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrea Cosentino (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (CAMEL-9835) Enable kafka consumer to subcribe to multiple topics
Date Thu, 07 Apr 2016 14:16:25 GMT

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

Andrea Cosentino reassigned CAMEL-9835:
---------------------------------------

    Assignee: Andrea Cosentino

> Enable  kafka consumer to subcribe to multiple topics
> -----------------------------------------------------
>
>                 Key: CAMEL-9835
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9835
>             Project: Camel
>          Issue Type: Wish
>          Components: camel-kafka
>    Affects Versions: 2.17.0
>         Environment: Any
>            Reporter: Jose Luis Pedrosa
>            Assignee: Andrea Cosentino
>            Priority: Minor
>             Fix For: 2.17.1
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> Kafka supports that one consumer is subcriber to multple topics. In their api when you
start the consumer you MUST provide an Array of topics.
> If we look in /java/org/apache/camel/component/kafka/KafkaConsumer.java
> Currently this is the piece of code that starts the subscriber:
> {code}
> LOG.debug("Subscribing {} to topic {}", threadId, topicName);
> consumer.subscribe(Arrays.asList(topicName));
> {code}
> just simply allowing the comma separated topic syntax and replacing one line of code
(and the documentation) it would be working.
> {code}
> LOG.debug("Subscribing {} to topic {}", threadId, topicName);
> consumer.subscribe(Arrays.asList(topicName.split(",")));
> {code}
> Despite the same could be achieved by adding more consumers (rotues) this causes a significant
amount of load (because of the commits) to kafka, so this really helps to improve performance.

> the topic has been already marked as mandatory, so that should keep the nullpointer safe.
> @UriParam @Metadata(required = "true")
> private String topic;
> thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message