I am working on a project where I need to fetch and process specific messages from a Kafka topic outside of the Kafka consumer. I want to be able to handle requests for specific messages and process them independently, without waiting for the messages to be consumed in sequential order.
- I have a Kafka consumer implemented that continuously polls a topic
and processes messages sequentially. - However, there are cases where I receive external requests to fetch and process a specific
message immediately, even if it is not the next message in line.
How can I efficiently fetch and process specific messages from Kafka outside of the consumer, allowing me to handle priority requests and process messages independently?
I am using Spring Boot and Java to create listener for Kafka