spring-cloud-stream icon indicating copy to clipboard operation
spring-cloud-stream copied to clipboard

@Component annotated beans composition doesn't work

Open LiquidSelf opened this issue 1 year ago • 2 comments

Hello, I try to use composition of two functions annotated with @Component, and I get null as argument. Without composition works as expected. @Bean annotated functions composition work as expected as well.

spring-cloud-stream-binder-kafka:4.0.3 and spring-cloud-stream-binder-kafka-streams:4.0.3

image image image

LiquidSelf avatar Apr 29 '24 09:04 LiquidSelf

@LiquidSelf, Could you put these components in a sample project and share with us? We can then triage the issue further to identify the issue.

sobychacko avatar Apr 29 '24 18:04 sobychacko

@LiquidSelf, Could you put these components in a sample project and share with us? We can then triage the issue further to identify the issue.

as simple as that https://github.com/LiquidSelf/sample/blob/main/src/main/resources/application.yaml#L6

LiquidSelf avatar Apr 29 '24 22:04 LiquidSelf

@LiquidSelf Thank you for the sample. I just added a fix where the Kafka Streams binder now supports Component beans for function composition. Could you test your app against the latest snapshot (4.1.2-SNAPSHOT)? Thanks!

sobychacko avatar May 01 '24 01:05 sobychacko

@LiquidSelf, Were you able to verify the fix?

sobychacko avatar May 06 '24 14:05 sobychacko

@LiquidSelf, Were you able to verify the fix?

hello, only fast verify on mock-demo project, fix works, but first component function getting called two times, and processing happens two times for first function in composition (only first) , e.g: image test-1#apply gets called two times, As a result processing occurs 2 times as well image

LiquidSelf avatar May 15 '24 15:05 LiquidSelf