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

Add BiFunction support to spring-cloud-stream-plugin #1087

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

LeovR
Copy link
Contributor

@LeovR LeovR commented Nov 20, 2024

No description provided.

Copy link

netlify bot commented Nov 20, 2024

Deploy Preview for springwolf-ui ready!

Name Link
🔨 Latest commit 3f0c3e3
🔍 Latest deploy log https://app.netlify.com/sites/springwolf-ui/deploys/673e1064de23b900087d610c
😎 Deploy Preview https://deploy-preview-1087--springwolf-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@timonback timonback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LeovR When looking at the documentation [0], spring may bind 'anything' that matches - that can be headers, but also another topic (-in-2).
Is there a way to figure this out, for example via the FunctionCatalog?

if (BiFunction.class.isAssignableFrom(type)) {
Type inputType = getTypeGenerics(element).get(0);
. // .get(1) could be used in the future
Type outputType = getTypeGenerics(element).get(2);


In any case, this is an improvement to the current state.
Thank you for this contribution.

[0] https://docs.spring.io/spring-cloud-stream/reference/kafka/kafka-streams-binder/programming-model.html#multiple-input-bindings (assuming this applies not only for KStream)

@LeovR
Copy link
Contributor Author

LeovR commented Nov 20, 2024

I think I have to dig deeper into the Kafka Streams Binder which behaves differently compared to the regular Kafka Binder.
At first look it seems that the Kafka Streams Binder does not use the FunctionCatalog like the regular Kafka Binder does.
The semantic seems to be different for the BiFunction types depending on the binder implementation.

@timonback
Copy link
Member

Fair enough, KStreams might be completely different anyway.

Since I do not use cloud stream in production, my knowledge is limited and I am very grateful for your input.

I'll merge the PR as it is good as it is right now. Feel free to open more PRs, and/or reopen the original issue.

@timonback timonback merged commit 8a38c5c into springwolf:master Nov 20, 2024
26 checks passed
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.

2 participants