Class AbstractKafkaMessageListener
- java.lang.Object
-
- org.wso2.carbon.inbound.endpoint.protocol.kafka.AbstractKafkaMessageListener
-
- Direct Known Subclasses:
KAFKAMessageListener
,SimpleKafkaMessageListener
public abstract class AbstractKafkaMessageListener extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractKafkaMessageListener.CONSUMER_TYPE
the consumer types are high level and simple,high level is used for kafka high level configuration and simple is used for kafka low level configuration
-
Field Summary
Fields Modifier and Type Field Description protected kafka.javaapi.consumer.ConsumerConnector
consumerConnector
protected List<kafka.consumer.ConsumerIterator<byte[],byte[]>>
consumerIte
protected InjectHandler
injectHandler
protected Properties
kafkaProperties
protected static org.apache.commons.logging.Log
log
protected int
threadCount
protected List<String>
topics
-
Constructor Summary
Constructors Constructor Description AbstractKafkaMessageListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
consumeMultipleTopics(String sequenceName)
Consume from multiple topicsabstract boolean
createKafkaConsumerConnector()
Create the connection with the zookeepervoid
destroy()
Destroy consuming the messagesboolean
hasMultipleTopicsToConsume()
Used to check whether there are multiple topics to consume fromabstract boolean
hasNext()
Check ConsumerIterator whether It has next valueabstract void
injectMessageToESB(String name)
Poll the messages from the zookeeper and injected to the sequenceabstract void
start()
Start to consume the messages from topics
-
-
-
Field Detail
-
threadCount
protected int threadCount
-
consumerConnector
protected kafka.javaapi.consumer.ConsumerConnector consumerConnector
-
injectHandler
protected InjectHandler injectHandler
-
kafkaProperties
protected Properties kafkaProperties
-
consumerIte
protected List<kafka.consumer.ConsumerIterator<byte[],byte[]>> consumerIte
-
log
protected static final org.apache.commons.logging.Log log
-
-
Method Detail
-
createKafkaConsumerConnector
public abstract boolean createKafkaConsumerConnector() throws Exception
Create the connection with the zookeeper- Throws:
Exception
-
start
public abstract void start() throws Exception
Start to consume the messages from topics- Throws:
Exception
-
destroy
public void destroy()
Destroy consuming the messages
-
injectMessageToESB
public abstract void injectMessageToESB(String name)
Poll the messages from the zookeeper and injected to the sequence
-
hasNext
public abstract boolean hasNext()
Check ConsumerIterator whether It has next value
-
hasMultipleTopicsToConsume
public boolean hasMultipleTopicsToConsume()
Used to check whether there are multiple topics to consume from
-
consumeMultipleTopics
public void consumeMultipleTopics(String sequenceName)
Consume from multiple topics
-
-