Skip to content

@RecordApplicationEvents does not work with @EmbeddedKafka #33860

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
spirosag opened this issue Nov 8, 2024 · 3 comments
Closed

@RecordApplicationEvents does not work with @EmbeddedKafka #33860

spirosag opened this issue Nov 8, 2024 · 3 comments
Assignees
Labels
in: test Issues in the test module

Comments

@spirosag
Copy link

spirosag commented Nov 8, 2024

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 8, 2024
@sbrannen sbrannen changed the title @RecordApplicationEvents does not work with @EmbeddedKafka @RecordApplicationEvents does not work with @EmbeddedKafka Nov 8, 2024
@sbrannen sbrannen added the in: test Issues in the test module label Nov 8, 2024
@simonbasle
Copy link
Contributor

simonbasle commented Nov 8, 2024

hey @spirosag. Even with #30020, it might indeed be the case that the event is published from a thread created too early for the test feature to catch it. If you can confirm this is the case, then @RecordApplicationEvents won't be usable in your case, unfortunately.
If not, please do provide a sample project.

@simonbasle simonbasle added the status: waiting-for-feedback We need additional information before we can continue label Nov 8, 2024
@simonbasle simonbasle self-assigned this Nov 8, 2024
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Nov 15, 2024
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2024
@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 22, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
in: test Issues in the test module
Projects
None yet
Development

No branches or pull requests

4 participants