-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Spring Integration 5.1 - integration flow convertion with @IntegrationConverter doesn't work #3052
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
Comments
artembilan
added a commit
to artembilan/spring-integration
that referenced
this issue
Sep 13, 2019
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
pushed a commit
that referenced
this issue
Sep 13, 2019
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**
artembilan
added a commit
that referenced
this issue
Sep 13, 2019
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** # Conflicts: # spring-integration-core/src/main/java/org/springframework/integration/handler/support/MessagingMethodInvokerHelper.java # spring-integration-core/src/test/java/org/springframework/integration/dsl/LambdaMessageProcessorTests.java
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Affects Version(s): <5.1>
Bug report
There is a regression from spring integration 5.0 to 5.1. Automatic casting with the instruction
.transform(Type.class, id -> id)
(or in Spring Integration 5.1.convert(Type.class)
) within aIntegrationFlow
doesn't work anymore for version 5.1.Following, I retype the SO issue (https://stackoverflow.com/questions/57910790/spring-integration-5-1-integration-flow-convertion-with-integrationconverter):
I upgrade my Spring boot version from
2.0.5.RELEASE
to2.1.8.RELEASE
(so Spring Integration from 5.0 to 5.1) and the automatic type casting inside integration flow doesn't work anymore. I am used to define a set of@IntegrationConverter
components and automatic casting with the operationtransform(Type.class, p -> p)
inside integration flow code but with the new version it seems to be broken.And the Main.java file:
Use with a shell:
With the previous version (2.0.5.RELEASE) the program work nicely like previously, but with the new version (2.1.8.RELEASE) I get this error (and no "OK" response):
What I have found is that the
ConversionService
has been remplaced byMessageConverter
and now Jackson is used to transform message from one type to another.[...]
As @artembilan answered this is a workaround:
The text was updated successfully, but these errors were encountered: