Replies: 1 comment
-
|
Take a look into that doc if global embedded Kafka is a solution for you: |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'd rather open a discussion instead of an issue yet :
I find the requirement of having to annotate our IT tests with
@DirtiesContextin order to use the@EmbeddedKafkaannotation a bit counterproductive. (as stated here in the documentation :https://docs.spring.io/spring-kafka/reference/testing.html#embedded-broker-with-springjunitconfig-annotations
From my experience destroying and restoring a context is a very time consuming operation. Big projects with lots of tests usually chase down all the cases that meddles with spring context to keep them to an absolute minimum.
I understand that there is a current race condition between the Kafka server and Spring regarding the shutdown hook and the cleaning of kafka's temporary files but using
@DirtiesContextis more like a very non performant workaround than an actual solution to this problem.I don't really have a solution in mind given the current state of the code but I feel like the KafkaServer should be able to give us some kind of actionable handle to better coordinate shutdowns.
What do you think ?
Beta Was this translation helpful? Give feedback.
All reactions