public class TaosConsumer<V> extends Object implements AutoCloseable
| 构造器和说明 |
|---|
TaosConsumer(Properties properties)
Note: after creating a
TaosConsumer you must always close()
it to avoid resource leaks. |
| 限定符和类型 | 方法和说明 |
|---|---|
Map<TopicPartition,Long> |
beginningOffsets(String topic) |
void |
close() |
void |
commitAsync() |
void |
commitAsync(OffsetCommitCallback<V> callback) |
void |
commitCallbackHandler(int code)
已过时。
|
void |
commitSync() |
Map<TopicPartition,Long> |
endOffsets(String topic) |
ConsumerRecords<V> |
poll(Duration timeout) |
Map<TopicPartition,Long> |
position(String topic) |
long |
position(TopicPartition tp) |
void |
seek(TopicPartition partition,
long offset) |
void |
subscribe(Collection<String> topics) |
Set<String> |
subscription() |
void |
unsubscribe() |
public TaosConsumer(Properties properties) throws SQLException
TaosConsumer you must always close()
it to avoid resource leaks.SQLExceptionpublic void subscribe(Collection<String> topics) throws SQLException
SQLExceptionpublic void unsubscribe()
throws SQLException
SQLExceptionpublic Set<String> subscription() throws SQLException
SQLExceptionpublic ConsumerRecords<V> poll(Duration timeout) throws SQLException
SQLException@Deprecated public void commitCallbackHandler(int code)
code - error codepublic void commitAsync()
public void commitAsync(OffsetCommitCallback<V> callback)
public void commitSync()
throws SQLException
SQLExceptionpublic void seek(TopicPartition partition, long offset) throws SQLException
SQLExceptionpublic long position(TopicPartition tp) throws SQLException
SQLExceptionpublic Map<TopicPartition,Long> position(String topic) throws SQLException
SQLExceptionpublic Map<TopicPartition,Long> beginningOffsets(String topic) throws SQLException
SQLExceptionpublic Map<TopicPartition,Long> endOffsets(String topic) throws SQLException
SQLExceptionpublic void close()
throws SQLException
close 在接口中 AutoCloseableSQLExceptionCopyright © 2023. All rights reserved.