Skip to content

Make SenderOptions/ReceiverOptions customizer generic #2685

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

Closed
kitkars opened this issue Apr 2, 2023 · 2 comments · Fixed by #2688
Closed

Make SenderOptions/ReceiverOptions customizer generic #2685

kitkars opened this issue Apr 2, 2023 · 2 comments · Fixed by #2688
Assignees
Labels

Comments

@kitkars
Copy link

kitkars commented Apr 2, 2023

Try to add this. We get compile time error as it is not generic and it expects SenderOptions<Object, Object>.

    @Bean
    public SenderOptionsCustomizer customizer(){
        return (a, b) -> b.withKeySerializer(new StringSerializer());
    }

even this will not fix.

    @Bean
    public SenderOptionsCustomizer customizer(){
        return (a, b) -> b.withKeySerializer(((Serializer<Object>) new StringSerializer()));
    }

@garyrussell garyrussell added the bug label Apr 3, 2023
@garyrussell garyrussell self-assigned this Apr 3, 2023
garyrussell added a commit to garyrussell/spring-cloud-stream that referenced this issue Apr 3, 2023
Resolves spring-cloud#2685

Required to allow customization of serializers/deserializers.
garyrussell added a commit to garyrussell/spring-cloud-stream that referenced this issue Apr 3, 2023
Resolves spring-cloud#2685

Required to allow customization of serializers/deserializers.
sobychacko pushed a commit that referenced this issue Apr 3, 2023
Resolves #2685

Required to allow customization of serializers/deserializers.
@garyrussell
Copy link
Contributor

@kitkars We've changed the interfaces but please note that the serializers/deserializers can also be set in the application.properties/yml (boot, binder and/or binding configuration in that order).

@kitkars
Copy link
Author

kitkars commented Apr 3, 2023

Thanks Gary for the quick fix.

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

Successfully merging a pull request may close this issue.

2 participants