public class Consumer extends Object
| 构造器和说明 |
|---|
Consumer(String projectName,
String topicName,
String subId,
ConsumerConfig config)
Mode : Collaborative Consumption
Auto assign shards : Y
Use offset service : Y
Perceive offset reset : Throw exception within commit interval
|
Consumer(String projectName,
String topicName,
String subId,
List<String> shardIds,
ConsumerConfig config)
Mode : Manually assign shards
Auto assign shards : N
Use offset service : Y
Perceive offset reset : Throw exception within commit interval
|
Consumer(String projectName,
String topicName,
String subId,
Map<String,Offset> offsetMap,
ConsumerConfig config)
Mode : Manually assign shards and offsets
Auto assign shards : N
Use offset service : Only for display (use local offset and just commit to server)
Perceive offset reset : Throw exception within commit interval
|
public Consumer(String projectName, String topicName, String subId, ConsumerConfig config)
projectName - The name of the project.topicName - The name of the topic.subId - The subscription id.config - The consumer configpublic Consumer(String projectName, String topicName, String subId, List<String> shardIds, ConsumerConfig config)
projectName - The name of the project.topicName - The name of the topic.subId - The subscription id.shardIds - The shard ids specified.config - The consumer configpublic Consumer(String projectName, String topicName, String subId, Map<String,Offset> offsetMap, ConsumerConfig config)
projectName - The name of the project.topicName - The name of the topic.subId - The subscription id.offsetMap - The offset map specified.config - The consumer configpublic com.aliyun.datahub.client.model.RecordEntry read(int maxRetry)
maxRetry - The max retry times.public String getConsumerId()
public void close()
Copyright © 2020 Alibaba Cloud Computing. All rights reserved.