public abstract class AbstractKafkaMessageListener extends Object
Modifier and Type | Class and 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
|
Modifier and Type | Field and 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 and Description |
---|
AbstractKafkaMessageListener() |
Modifier and Type | Method and Description |
---|---|
void |
consumeMultipleTopics(String sequenceName)
Consume from multiple topics
|
abstract boolean |
createKafkaConsumerConnector()
Create the connection with the zookeeper
|
void |
destroy()
Destroy consuming the messages
|
boolean |
hasMultipleTopicsToConsume()
Used to check whether there are multiple topics to consume from
|
abstract boolean |
hasNext()
Check ConsumerIterator whether It has next value
|
abstract void |
injectMessageToESB(String name)
Poll the messages from the zookeeper and injected to the sequence
|
abstract void |
start()
Start to consume the messages from topics
|
protected int threadCount
protected kafka.javaapi.consumer.ConsumerConnector consumerConnector
protected InjectHandler injectHandler
protected Properties kafkaProperties
protected List<kafka.consumer.ConsumerIterator<byte[],byte[]>> consumerIte
protected static final org.apache.commons.logging.Log log
public abstract boolean createKafkaConsumerConnector() throws Exception
Exception
public abstract void start() throws Exception
Exception
public void destroy()
public abstract void injectMessageToESB(String name)
public abstract boolean hasNext()
public boolean hasMultipleTopicsToConsume()
public void consumeMultipleTopics(String sequenceName)
Copyright © 2018 WSO2. All rights reserved.