public class KAFKAMessageListener extends AbstractKafkaMessageListener
AbstractKafkaMessageListener.CONSUMER_TYPEconsumerConnector, consumerIte, injectHandler, kafkaProperties, log, threadCount, topics| Constructor and Description |
|---|
KAFKAMessageListener(int threadCount,
List<String> topics,
Properties kafkaProperties,
InjectHandler injectHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
consumeMultipleTopics(String name)
Consume from multiple topics
|
boolean |
createKafkaConsumerConnector()
Create the connection with the zookeeper to consume the messages
|
boolean |
hasMultipleTopicsToConsume()
Used to check whether there are multiple topics to consume from
|
boolean |
hasNext()
Check ConsumerIterator whether It has next value
|
boolean |
hasNext(kafka.consumer.ConsumerIterator<byte[],byte[]> consumerIterator) |
void |
injectMessageToESB(String name)
Poll the messages from the zookeeper and injected to the sequence
|
void |
injectMessageToESB(String sequenceName,
kafka.consumer.ConsumerIterator<byte[],byte[]> consumerIterator) |
void |
start()
Starts topics consuming the messages,the message can be consumed by topic or topic filter which are white list and black list.
|
protected void |
startConsumers(List<kafka.consumer.KafkaStream<byte[],byte[]>> streams)
Use one stream from kafka stream iterator
|
destroypublic KAFKAMessageListener(int threadCount,
List<String> topics,
Properties kafkaProperties,
InjectHandler injectHandler)
throws Exception
Exceptionpublic boolean createKafkaConsumerConnector()
throws Exception
createKafkaConsumerConnector in class AbstractKafkaMessageListenerExceptionpublic void start()
throws Exception
start in class AbstractKafkaMessageListenerExceptionprotected void startConsumers(List<kafka.consumer.KafkaStream<byte[],byte[]>> streams)
streams - public void injectMessageToESB(String name)
AbstractKafkaMessageListenerinjectMessageToESB in class AbstractKafkaMessageListenerpublic void injectMessageToESB(String sequenceName, kafka.consumer.ConsumerIterator<byte[],byte[]> consumerIterator)
public boolean hasNext()
AbstractKafkaMessageListenerhasNext in class AbstractKafkaMessageListenerpublic boolean hasNext(kafka.consumer.ConsumerIterator<byte[],byte[]> consumerIterator)
public boolean hasMultipleTopicsToConsume()
AbstractKafkaMessageListenerhasMultipleTopicsToConsume in class AbstractKafkaMessageListenerpublic void consumeMultipleTopics(String name)
AbstractKafkaMessageListenerconsumeMultipleTopics in class AbstractKafkaMessageListenerCopyright © 2018 WSO2. All rights reserved.