Skip to content

EnablePersistentDomainEvents annotation can't be used #374

Open
@v3rm0n

Description

@v3rm0n

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions