Start Kafka Consumer Programatically using Spring Kafka #2798
rajjaiswalsaumya
started this conversation in
General
Replies: 1 comment
-
You can use the https://docs.spring.io/spring-kafka/docs/current/reference/html/#annotation-properties See this answer for an example: https://stackoverflow.com/questions/68744775/can-i-add-topics-to-my-kafkalistener-at-runtime/68745230#68745230 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
One of the use cases for automation is to create runtime SCRAM users and test the functionality e2e. In this case, if two tests run in parallel will fail as the listener will try to read the data sent by another test. Is there a way to use Spring Kafka to run the listener programmatically? Currently programatic way requires
KafkaListener
annotation to have an id param to start the container programmatically but that id becomes static. In my case, i want to provide it dynamically into the function which will be invoked by the tests so that parallel tests will have their own containers.I don't want to switch to apache kafka directly as most of the heavy lifting is done by Spring. Hence looking for a way to provide container id dynamically.
Beta Was this translation helpful? Give feedback.
All reactions