You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "web_nabble@sunilsamuel.com" <we...@sunilsamuel.com> on 2015/12/24 01:07:59 UTC

pollEnricher + Kafka + Aggregator

Hello,

I am trying to use the pollEnrich to consume messages from a kafka server in
the following manner:

A "timer" based route runs periodically
Use "pollEnrich" with an AggregatorStrategy to get as much messages from the
topic until the pollEnricher expires.

The issues is that the pollEnrich will only get one message at a time, no
matter what type of AggregatorStrategy I use.I saw the following in the
documentation for pollEnrich :
pollEnrich only accept one message as response. That means that if you
target to enrich your original message with the enricher collecting messages
from a seda, ... components using an aggregation strategy. Only one response
message will be aggregated with the original message.
Is there any way that I can get more than one message from kafka in this
manner.
I use the following route:
		from("timer://foo?fixedRate=true&period=10000")			.log("IN THE TIMER")		
.setHeader("kafka.OFFSET",constant("smallest"))		
.pollEnrich("kafka:192.168.111.54:9092?topic=test&"+				
"zookeeperHost=192.168.111.54&zookeeperPort=2181&"+				
"groupId=groupBatch",					5000L, new EnrichAggregatorStrategy()			)		
.beanRef("commonHelper","aggregate")			.log("FROM THE TIMER [${body}]")
The EnrichAggregatorStrategy is a very simple class that extends the
Aggregator Strategy so I will not include that here (unless requested).

Is there any way I can get all the messages that I can within the 5000L time
period?

Thank You,
sunil.



--
View this message in context: http://camel.465427.n5.nabble.com/pollEnricher-Kafka-Aggregator-tp5775433.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: pollEnricher + Kafka + Aggregator

Posted by "web_nabble@sunilsamuel.com" <we...@sunilsamuel.com>.
Hello,

Forgot to mention that I am using Camel 2.12 (Fuse 6.1).

thanks,
sunil.



--
View this message in context: http://camel.465427.n5.nabble.com/pollEnricher-Kafka-Aggregator-tp5775433p5775434.html
Sent from the Camel Development mailing list archive at Nabble.com.