Method | Description |
Consumer | Recommended. In the actual production environment, use Go Consumer to consume log data to improve efficiency. Go Consumer consumes the data of all shards in a topic in a balanced way. Go Consumer features asynchronous consumption, high performance, retry on failure, and graceful shutdown. To get the sample code, refer to Using Go Consumer to consume logs. For information on how to use consumer groups to consume logs, refer to Use ConsumeLogs to consume logs and Use TLS SDK for Go consumer groups to consume logs. |
ConsumeLogs | Not recommended. TLS allows you to call ConsumeLogs to consume logs using synchronous requests. The progress of consuming logs is limited by the read and write performance of a single shard and must be maintained manually. In addition, the consumption logic and process are cumbersome in automatic sharding scenarios. If you use the HashKey Routing Shard mode when you call PutLogs, log data is written to the specified shard in sequence. In this case, you can call ConsumeLogs to consume the log data in a specific shard. To get the sample code, refer to Using the synchronous ConsumeLogs API action to consume logs. |