Class AbstractKafkaMessageListener
java.lang.Object
org.wso2.carbon.inbound.endpoint.protocol.kafka.AbstractKafkaMessageListener
- Direct Known Subclasses:
KAFKAMessageListener,SimpleKafkaMessageListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumthe 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
FieldsModifier and TypeFieldDescriptionprotected kafka.javaapi.consumer.ConsumerConnectorprotected List<kafka.consumer.ConsumerIterator<byte[], byte[]>> protected InjectHandlerprotected Propertiesprotected static final org.apache.commons.logging.Logprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconsumeMultipleTopics(String sequenceName) Consume from multiple topicsabstract booleanCreate the connection with the zookeepervoiddestroy()Destroy consuming the messagesbooleanUsed to check whether there are multiple topics to consume fromabstract booleanhasNext()Check ConsumerIterator whether It has next valueabstract voidinjectMessageToESB(String name) Poll the messages from the zookeeper and injected to the sequenceabstract voidstart()Start to consume the messages from topics
-
Field Details
-
threadCount
protected int threadCount -
topics
-
consumerConnector
protected kafka.javaapi.consumer.ConsumerConnector consumerConnector -
injectHandler
-
kafkaProperties
-
consumerIte
-
log
protected static final org.apache.commons.logging.Log log
-
-
Constructor Details
-
AbstractKafkaMessageListener
public AbstractKafkaMessageListener()
-
-
Method Details
-
createKafkaConsumerConnector
Create the connection with the zookeeper- Throws:
Exception
-
start
Start to consume the messages from topics- Throws:
Exception
-
destroy
public void destroy()Destroy consuming the messages -
injectMessageToESB
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
Consume from multiple topics
-