问题
I have a Kafka cluster(version : 0.10.1.0), with 9 brokers and 10 partitions.
I tried consuming messages from a java application using camel kafka 2.14.3
. Here is my camel route
<route id="ReadFromTopic">
<from uri="kafka:[[broker.list]]?topic=[[topic]]&zookeeperHost=[[zookeeper.host]]&zookeeperPort=[[zookeeper.port]]&groupId=[[consumer.group]]&consumerStreams=[[concurrency]]" />
<log message="Message Read from kafka topic : [[topic]]" loggingLevel="INFO" />
<log message=" BODY is ${body}" loggingLevel="INFO" />
</route>
Route starts fine, but isn't reading any messages.
When I tried using camel kafka 3.0.1
, with route as follows, I was able to read messages
<route id="ReadFromTopic">
<from uri="kafka:[[topic]]?brokers=[[broker.list]]&groupId=[[consumer.group]]" />
<log message="read message : ${body}" />
</route>
Because of the dependencies I have, I can only use camel kafka 2.14.3
. How can I solve this issue?
回答1:
I just found this Wiki page where the different options of Camel-Kafka depending on the version are listed.
Checkout the options for version 2.16 or older. The component documentation for Camel 2.x seems to be valid for 2.17 or newer.
来源:https://stackoverflow.com/questions/62381728/camel-kafka-version-2-14-3-unable-to-read-messages