-
Notifications
You must be signed in to change notification settings - Fork 155
Adding spring-boot-starter-data-jpa
dependency stops @ApplicationModuleListener
receiving events
#477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
when I add
In hindsight when I look at the code snippets in the events reference page I can see the implication that all events need to be transacted, but maybe it should be more explict? |
I am inclined your original code won't work without the JPA starter either as |
Hi Oliver, Apologies for the delayed response, I was on holiday 🙂 I've created the a repo where I replicated the above. https://github.com/timothysparg/sm-477 If you run that app without any modifications it should fire and receive events. |
@timothysparg I ran into the exact same issue. The issue is, that the method that produces publishes your events needs to be As far as I understood it, as long as you don't add a database starter to your Modulith project, Modulith won't try to persist your events and thus no As soon as a database starter is part of your project it will automatically connect to your datasource to keep your events in a table. This may be an oversight in autoconfiguration and/or documentation. |
I think you need to add an explicit modulith db starter for it to persist events to the database. Or at least that is the behaviour that I have seen.
Broadly this is what I am trying to understand - if it is the expected behaviour I feel like it should be more explicit and if possible shouldn't just silently fail. There will be other people trying to get started who run into the same thing. |
Thanks, everyone, for chiming in here. I dug into the example and here are my findings.
I've filed spring-projects/spring-framework#32319 to fix the transactional event listener handling in case no transactional infrastructure is enabled. I am inclined to close this as working as designed. |
spring-boot-starter-data-jpa
dependency stops @ApplicationModuleListener
receiving events
the following snippet works until I add the
spring-boot-starter-data-jpa
dependency.Is there something that I am missing ?
The text was updated successfully, but these errors were encountered: