At the moment BeanRegistrationExcludeFilter is only possible on a bean that also implements an AOT contribution. This is not really obvious from the method signature for a start, and it would be nice if it would be automatically available from bean factory callbacks during the preparation phase.
For instance, adding this to an ImportBeanDefinitionRegistrar implementation does nothing.
See https://github.com/spring-projects/spring-boot/issues/34563 for an example.
Comment From: snicoll
Looking at the example in Spring Boot, it probably is easier to just set the attribute that #33243 promotes.