GH-3844: Rework messaging annotation with @Bean (#3877)

* GH-3844: Rework messaging annotation with @Bean

Fixes https://github.com/spring-projects/spring-integration/issues/3844

* Make `MessagingAnnotationPostProcessor` as a `BeanDefinitionRegistryPostProcessor`
to process bean definitions as early as possible and register respective messaging
components at that early phase
* Make bean definitions parsing logic optional for AOT and native mode since beans
have bean parsed during AOT building phase
* Introduce a `BeanDefinitionPropertiesMapper` for easier mapping
of the annotation attributes to the target `BeanDefinition`
* Remove `@Bean`-related logic from method parsing process
* Change the logic for `@Bean`-based endpoint bean names:
since we don't deal with methods on the bean definition phase, then method name
does not make sense.
It even may mislead if we `@Bean` name is based on a method by default, so we end up
with duplicated word in the target endpoint bean name.
Now we don't
* Fix `configuration.adoc` respectively for a new endpoint bean name logic
* In the end the new logic in the `AbstractMethodAnnotationPostProcessor`
is similar to XML parsers: we feed annotation attributes to the
`AbstractStandardMessageHandlerFactoryBean` impls

* * Fix language in docs and exception message
This commit is contained in:
Artem Bilan
2022-08-22 12:38:23 -04:00
committed by GitHub
parent c1dbb02c51
commit ca138c0c06
33 changed files with 1136 additions and 819 deletions

View File

@@ -100,9 +100,7 @@ public class MockMessageSourceTests {
@Test
public void testMockMessageSourceInConfig() {
Lifecycle channelAdapter =
this.applicationContext
.getBean("mockMessageSourceTests.Config.testingMessageSource.inboundChannelAdapter",
Lifecycle.class);
this.applicationContext.getBean("testingMessageSource.inboundChannelAdapter", Lifecycle.class);
channelAdapter.start();
Message<?> receive = this.results.receive(10_000);