Run a method once after spring kafka consumer starts

Solution 1:

Add an event listener to listen for a consumer started event. It is called on the same thread (by default).

https://docs.spring.io/spring-kafka/docs/current/reference/html/#events

https://docs.spring.io/spring-kafka/docs/current/reference/html/#event-consumption