Reputation: 155
I understand that KafkaConsumer is a client from Apache's Kafka library, which is pollable on demand, and is therefore in an infinite loop that sends out a heartbeat based on an interval. KafkaListener is an annotation applied to a method so that Spring Kafka will invoke it to process a message.
That said, I'm not sure what the design advantages / disadvantages are of either approach. Does one allow for a better or worse consumption pattern, in your opinion? And if so, what is the difference?
Upvotes: 0
Views: 834
Reputation: 174554
See the goals on the project page; essentially it provides a higher level abstraction, taking care of the low level stuff so you can concentrate on the business logic. It uses familiar concepts for Spring users that use other technologies (JMS, RabbitMQ etc).
It generally provides a faster on-ramp for those new to Apache Kafka.
Upvotes: 2