Skip to content

PublisherAnnotationBeanPostProcessor has dependency on itself, breaks when using Spring Boot #3694

@kewne

Description

@kewne

If I declare the following configuration class in a Spring Boot application:

@Configuration
@EnablePublisher
public class IntegrationConfiguration

the application fails to start because the instantiated PublisherAnnotationBeanPostProcessor requests itself as a bean.

By default, Spring Boot disallows this unless you set spring.main.allow-circular-references: true, which IMO you shouldn't do without a good reason.

Expected behavior

No circular dependency error should be raised.

PublisherAnnotationBeanPostProcessor could still check for a duplicate with an explicit bean request;
perhaps just checking whether a definition exists would be enough.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions