public class KafkaSimpleConsumer extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
KafkaSimpleConsumer.ConsumeThread
start the thread to run the consumer
|
| Modifier and Type | Field and Description |
|---|---|
static String |
CONF_SPLIT |
static int |
CONSUME_BUFFER_SIZE |
static int |
CONSUME_TIME_OUT |
static int |
ERR_COUNT_RECONN |
static int |
FETCH_SIZE |
static String |
PORT_SPLIT |
static int |
QUEUE_SIZE |
static long |
SLEEPING_TIME |
static int |
THREAD_POOL_SIZE |
| Constructor and Description |
|---|
KafkaSimpleConsumer(KafkaConf conf)
constructor by kafka config
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
close thread pool
|
KafkaMsg |
consume()
consume message
|
long |
findMaxOffset(int partition)
find max offset
|
long |
findMinOffset(int partition)
find min offset
|
int |
getQueueSize()
getOrigin queue size
|
String |
getTopic()
getOrigin topic in this consumer
|
boolean |
isConsumeEmpty()
is queue empty
|
public static final int QUEUE_SIZE
public static final String CONF_SPLIT
public static final String PORT_SPLIT
public static final int CONSUME_TIME_OUT
public static final int CONSUME_BUFFER_SIZE
public static final int FETCH_SIZE
public static final int ERR_COUNT_RECONN
public static final long SLEEPING_TIME
public static final int THREAD_POOL_SIZE
public KafkaSimpleConsumer(KafkaConf conf)
conf - public long findMaxOffset(int partition)
public long findMinOffset(int partition)
partition - public String getTopic()
public void close()
public KafkaMsg consume() throws Exception
Exceptionpublic int getQueueSize()
public boolean isConsumeEmpty()
Copyright © 2016. All rights reserved.