Class SimpleKafkaMessageListener
- java.lang.Object
-
- org.wso2.carbon.inbound.endpoint.protocol.kafka.AbstractKafkaMessageListener
-
- org.wso2.carbon.inbound.endpoint.protocol.kafka.SimpleKafkaMessageListener
-
public class SimpleKafkaMessageListener extends AbstractKafkaMessageListener
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.wso2.carbon.inbound.endpoint.protocol.kafka.AbstractKafkaMessageListener
AbstractKafkaMessageListener.CONSUMER_TYPE
-
-
Field Summary
-
Fields inherited from class org.wso2.carbon.inbound.endpoint.protocol.kafka.AbstractKafkaMessageListener
consumerConnector, consumerIte, injectHandler, kafkaProperties, log, threadCount, topics
-
-
Constructor Summary
Constructors Constructor Description SimpleKafkaMessageListener(Properties kafkaProperties, InjectHandler injectHandler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
createKafkaConsumerConnector()
Create the connection with the zookeeperstatic long
getLastOffset(kafka.javaapi.consumer.SimpleConsumer consumer, String topic, int partition, long whichTime, String clientName)
boolean
hasNext()
Check ConsumerIterator whether It has next valuevoid
injectMessageToESB(String name)
Poll the messages from the zookeeper and injected to the sequenceboolean
run()
void
start()
Start to consume the messages from topics-
Methods inherited from class org.wso2.carbon.inbound.endpoint.protocol.kafka.AbstractKafkaMessageListener
consumeMultipleTopics, destroy, hasMultipleTopicsToConsume
-
-
-
-
Constructor Detail
-
SimpleKafkaMessageListener
public SimpleKafkaMessageListener(Properties kafkaProperties, InjectHandler injectHandler) throws Exception
- Throws:
Exception
-
-
Method Detail
-
createKafkaConsumerConnector
public boolean createKafkaConsumerConnector() throws Exception
Description copied from class:AbstractKafkaMessageListener
Create the connection with the zookeeper- Specified by:
createKafkaConsumerConnector
in classAbstractKafkaMessageListener
- Throws:
Exception
-
start
public void start() throws Exception
Description copied from class:AbstractKafkaMessageListener
Start to consume the messages from topics- Specified by:
start
in classAbstractKafkaMessageListener
- Throws:
Exception
-
injectMessageToESB
public void injectMessageToESB(String name)
Description copied from class:AbstractKafkaMessageListener
Poll the messages from the zookeeper and injected to the sequence- Specified by:
injectMessageToESB
in classAbstractKafkaMessageListener
-
hasNext
public boolean hasNext()
Description copied from class:AbstractKafkaMessageListener
Check ConsumerIterator whether It has next value- Specified by:
hasNext
in classAbstractKafkaMessageListener
-
-