public class SimpleKafkaMessageListener extends AbstractKafkaMessageListener
AbstractKafkaMessageListener.CONSUMER_TYPEconsumerConnector, consumerIte, injectHandler, kafkaProperties, log, threadCount, topics| Constructor and Description |
|---|
SimpleKafkaMessageListener(Properties kafkaProperties,
InjectHandler injectHandler) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
createKafkaConsumerConnector()
Create the connection with the zookeeper
|
static long |
getLastOffset(kafka.javaapi.consumer.SimpleConsumer consumer,
String topic,
int partition,
long whichTime,
String clientName) |
boolean |
hasNext()
Check ConsumerIterator whether It has next value
|
void |
injectMessageToESB(String name)
Poll the messages from the zookeeper and injected to the sequence
|
boolean |
run() |
void |
start()
Start to consume the messages from topics
|
consumeMultipleTopics, destroy, hasMultipleTopicsToConsumepublic SimpleKafkaMessageListener(Properties kafkaProperties, InjectHandler injectHandler) throws Exception
Exceptionpublic boolean createKafkaConsumerConnector()
throws Exception
AbstractKafkaMessageListenercreateKafkaConsumerConnector in class AbstractKafkaMessageListenerExceptionpublic void start()
throws Exception
AbstractKafkaMessageListenerstart in class AbstractKafkaMessageListenerExceptionpublic void injectMessageToESB(String name)
AbstractKafkaMessageListenerinjectMessageToESB in class AbstractKafkaMessageListenerpublic boolean hasNext()
AbstractKafkaMessageListenerhasNext in class AbstractKafkaMessageListenerCopyright © 2018 WSO2. All rights reserved.