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 booleancreateKafkaConsumerConnector()Create the connection with the zookeeperstatic longgetLastOffset(kafka.javaapi.consumer.SimpleConsumer consumer, String topic, int partition, long whichTime, String clientName)booleanhasNext()Check ConsumerIterator whether It has next valuevoidinjectMessageToESB(String name)Poll the messages from the zookeeper and injected to the sequencebooleanrun()voidstart()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 ExceptionDescription copied from class:AbstractKafkaMessageListenerCreate the connection with the zookeeper- Specified by:
createKafkaConsumerConnectorin classAbstractKafkaMessageListener- Throws:
Exception
-
start
public void start() throws ExceptionDescription copied from class:AbstractKafkaMessageListenerStart to consume the messages from topics- Specified by:
startin classAbstractKafkaMessageListener- Throws:
Exception
-
injectMessageToESB
public void injectMessageToESB(String name)
Description copied from class:AbstractKafkaMessageListenerPoll the messages from the zookeeper and injected to the sequence- Specified by:
injectMessageToESBin classAbstractKafkaMessageListener
-
hasNext
public boolean hasNext()
Description copied from class:AbstractKafkaMessageListenerCheck ConsumerIterator whether It has next value- Specified by:
hasNextin classAbstractKafkaMessageListener
-
-