Skip to content

GH-3052: Fix custom converters for lambdas #3053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2019

Conversation

artembilan
Copy link
Member

Fixes #3052

Starting with version 5.1, a LambdaMessageProcessor is based on the
MessageConverter instead of plain ConversionService.
(A ConfigurableCompositeMessageConverter is used from the application
context.)
However a type conversion based on the @IntegrationConverter is lost
in the GenericMessageConverter because it doesn't use an
integrationConversionService from the application context

  • Change ConfigurableCompositeMessageConverter to configure a
    GenericMessageConverter with an integrationConversionService
    if any
  • Fix MessagingMethodInvokerHelper to populate a BeanFactory into
    its internal ConfigurableCompositeMessageConverter
  • Ensure in the LambdaMessageProcessorTests that
    @IntegrationConverter is applied for ``LambdaMessageProcessor` as well

Cherry-pick to 5.1.x

Fixes spring-projects#3052

Starting with version `5.1`, a `LambdaMessageProcessor` is based on the
`MessageConverter` instead of plain `ConversionService`.
(A `ConfigurableCompositeMessageConverter` is used from the application
context.)
However a type conversion based on the `@IntegrationConverter` is lost
in the `GenericMessageConverter`  because it doesn't use an
`integrationConversionService` from the application context

* Change `ConfigurableCompositeMessageConverter` to configure a
 `GenericMessageConverter`  with an  `integrationConversionService`
 if any
* Fix `MessagingMethodInvokerHelper` to populate a `BeanFactory` into
its internal `ConfigurableCompositeMessageConverter`
* Ensure in the `LambdaMessageProcessorTests` that
`@IntegrationConverter` is applied for ``LambdaMessageProcessor` as well

**Cherry-pick to 5.1.x**
@garyrussell garyrussell merged commit 9272782 into spring-projects:master Sep 13, 2019
@garyrussell
Copy link
Contributor

Cherry-pick is not clean - please backport.

@artembilan
Copy link
Member Author

Back-ported to 5.1.x as addf2db after fixing conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spring Integration 5.1 - integration flow convertion with @IntegrationConverter doesn't work
2 participants