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.