Class SimpleKafkaMessageListener
java.lang.Object
org.wso2.carbon.inbound.endpoint.protocol.kafka.AbstractKafkaMessageListener
org.wso2.carbon.inbound.endpoint.protocol.kafka.SimpleKafkaMessageListener
-
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
ConstructorsConstructorDescriptionSimpleKafkaMessageListener(Properties kafkaProperties, InjectHandler injectHandler) -
Method Summary
Modifier and TypeMethodDescriptionbooleanCreate 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 topicsMethods inherited from class org.wso2.carbon.inbound.endpoint.protocol.kafka.AbstractKafkaMessageListener
consumeMultipleTopics, destroy, hasMultipleTopicsToConsume
-
Constructor Details
-
SimpleKafkaMessageListener
public SimpleKafkaMessageListener(Properties kafkaProperties, InjectHandler injectHandler) throws Exception - Throws:
Exception
-
-
Method Details
-
createKafkaConsumerConnector
Description copied from class:AbstractKafkaMessageListenerCreate the connection with the zookeeper- Specified by:
createKafkaConsumerConnectorin classAbstractKafkaMessageListener- Throws:
Exception
-
start
Description copied from class:AbstractKafkaMessageListenerStart to consume the messages from topics- Specified by:
startin classAbstractKafkaMessageListener- Throws:
Exception
-
injectMessageToESB
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
-
run
- Throws:
Exception
-
getLastOffset
-