com.taosdata.jdbc.common

## 接口 Consumer<V>

所有已知实现类:
  JNIConsumer, WSConsumer

    public interface Consumer<V>

### 方法概要

所有方法 实例方法 抽象方法
`void` `close()` close consumer
`void` `commitAsync(OffsetCommitCallback<V> callback)`
`void` `commitSync()` commit offset with sync
`void` `create(Properties properties)` create consumer
`ConsumerRecords<V>` `poll(Duration timeout, Deserializer<V> deserializer)` get result records
`void` `subscribe(Collection<String> topics)` subscribe topics
`Set<String>` `subscription()` get subscribe topics
`void` `unsubscribe()` unsubscribe topics

### 方法详细资料

#### create

    void create(Properties properties)
         throws SQLException

create consumer

参数:
  `properties` - ip / port / user / password and so on.
抛出:
  `SQLException` - jni exception

#### subscribe

    void subscribe(Collection<String> topics)
            throws SQLException

subscribe topics

参数:
  `topics` - collection of topics
抛出:
  `SQLException` - jni exception

#### unsubscribe

    void unsubscribe()
              throws SQLException

unsubscribe topics

抛出:
  `SQLException` - jni exception

#### subscription

    Set<String> subscription()
                      throws SQLException

get subscribe topics

返回:
  topic set
抛出:
  `SQLException` - jni exception

#### poll

    ConsumerRecords<V> poll(Duration timeout,
                            Deserializer<V> deserializer)
                     throws SQLException

get result records

参数:
  `timeout` - wait time for poll data
  `deserializer` - convert resultSet to javaBean
返回:
  ConsumerRecord is the collection of javaBean
抛出:
  `SQLException` - java reflect exception or resultSet convert exception

#### commitSync

    void commitSync()
             throws SQLException

commit offset with sync

抛出:
  `SQLException` - jni exception

#### close

    void close()
        throws SQLException

close consumer

抛出:
  `SQLException` - jni exception

#### commitAsync

    void commitAsync(OffsetCommitCallback<V> callback)