spring-projects / spring-projects/spring-modulith
EnablePersistentDomainEvents annotation can't be used
Open
@odrotbohm is already working on this.
Since Jan 16, 2024.
meta: waiting for feedback
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
Looks like EnablePersistentDomainEvents will select EventPublicationConfiguration for import and at the same time EventPublicationAutoConfiguration extends EventPublicationConfiguration so if you add EnablePersistentDomainEvents annotation then the application fails to start
***************************
APPLICATION FAILED TO START
***************************
Description:
The bean 'eventPublicationRegistry', defined in class path resource [org/springframework/modulith/events/config/EventPublicationAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/modulith/events/config/EventPublicationConfiguration.class] and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
Workaround for now seems to be to either enable overriding or just not using the annotation and manually importing your EventPublicationConfigurationExtension and EventSerializationConfigurationExtension implementations.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.