1 Introduction to concepts
2 message reception
2.1 Required parameters
The required parameters for creating a consumer are as follows:
2.2 Subscribe to topics and partitions
2.3 Deserialization
2.4 Displacement submission
Automatic submission
Synchronous submission: first turn off automatic submission, and then manually synchronize submission; in the case of multiple consumers in the same group, if there is only one consumer, there is no problem of repeated consumption.
Asynchronous submission
2.5 Specified displacement consumption
Kafka data is persistent and can be retrieved repeatedly.
Optimization: increase whether the consumer is allocated to the partition
Start consumption at the end of the designated partition for real-time data display
Demonstrate displacement out of bounds operation
2.6 Rebalance monitor
The default is not implemented. The following case: When rebalancing occurs, submit the consumption displacement offset.
2.7 Consumer Interceptor
Consumer interceptor definition
Consumer interceptor usage
3 Consumer parameter supplement
For more configuration parameters, please refer to the Kafka configuration file description