Skip to content
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

use-native-decoding=true does not work when combined with function composition #1144

Closed
carolmorneau opened this issue May 7, 2024 · 4 comments
Assignees
Labels
Milestone

Comments

@carolmorneau
Copy link

carolmorneau commented May 7, 2024

Description
use-native-decoding=true works as expected when there is no function composition. The skipInputConversion flag in SimpleFunctionRegistry is properly set and payload conversion is not attempted.

However, if function composition is used in combination with use-native-encoding=true, the skipInputConversion flag is always false and payload conversion is attempted.

To Reproduce
Using this sample project which is based on the function-composition-rabbit sample

  • Run the sample with the issue2945 profile
  • Send some data to the RabbitMQ exchange (at least 3 messages since batch-size=3)
  • Notice that an exception is thrown from JsonMessageConverter; however, we would expect skipInputConversion=true and converters to not be called.

Expected behavior

I would expect the framework to not attempt payload conversion when use-native-decoding=true

@olegz
Copy link
Contributor

olegz commented May 8, 2024

i will transfer this to spring-cloud-function

@olegz olegz transferred this issue from spring-cloud/spring-cloud-stream May 8, 2024
@olegz olegz self-assigned this May 8, 2024
@olegz olegz added the bug label May 8, 2024
@olegz
Copy link
Contributor

olegz commented May 8, 2024

We need to ensure that if setSkipInputConversion is set on a function then even if this function is composed from multiple functions the settings propagates to all of them

@carolmorneau
Copy link
Author

Thank you @olegz
It was not my main focus but I believe the same issue takes place for the producer property use-native-encoding=true.

Thank you

@carolmorneau
Copy link
Author

I retested with 4.1.2-SNAPSHOT and this issue appears to be fixed. Thank you @olegz

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

No branches or pull requests

2 participants