Skip to content

@RecordApplicationEvents does not work with @EmbeddedKafka #33860

Closed as not planned
@spirosag

Description

@spirosag

I have a project with spring-kafka where a @KafkaListener receives a kafka record and produces a spring boot application event. I have a @SpringBootTest with @EmbeddedKafka and @RecordApplicationEvents to test this functionality.
Although my event is published correctly it is not recorded.

I am using spring boot 3.2.3 and I was expecting that with #30020 it should record it. Or is the kafka thread created before the test starts so it is expected not to be created?

I have ended using a custom solution with a test @EventListenert and it works as expected but I'd prefer to use the recorded events if possible for simplicity.

I can also provide a sample project with the setup if needed.

Metadata

Metadata

Assignees

Labels

in: testIssues in the test module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions