-
Notifications
You must be signed in to change notification settings - Fork 595
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
Reactive Consumer Function not deserializing data from rabbitmq correctly #2056
Comments
Update When I used spring cloud version, Hoxton.SR8, the reactive consumer works as expect. There must be a conflict that must be resolved with the latest spring cloud version. |
I see the same behaviour after upgrading from Setup I don't use reactive functions but simple functional composition, not sure if this makes any difference at all.
When downgrading back to |
Can you please try with SR10? I can't seem to reproduce it and also pushed a missing test this morning to both |
@olegz |
@dmsilver2 Yes, Hoxton latest is SR9, however Spring Cloud Stream has its own releases cycles which generally match up with Spring Cloud, but not always. So the latest is Horsham.SR10 which is 3.0.10. |
I am experiencing this issue too with SR9 and Azure Service Bus. I was able to see that the conversionHint is added to the message converter because the type is believed to be Flux (will try to share more details later and will soon test SR10). |
I think this is related: #2054 |
@olegz I have added to my dependencies section |
@dmsilver2 take a look here: https://github.com/spring-cloud/spring-cloud-stream-samples/blob/master/kafka-security-samples/kafka-ssl-demo/pom.xml In my case, since I am also using
|
The issue is still there for me with Horsham.SR10. The issue is due to the
Which in turn makes the Json converter look for a Jackson View. My function signature is |
Downgrading to Hoxton.SR8, Spring Cloud Stream 3.0.8, fixes the issue for me, i.e. the |
I am still struggling to understand, since there s a test that validates it. Can someone please provide a way to reproduce the issue (a test in a form of PR or just copy/paste the code here)? |
I'll try to share a sample project later today. |
In the meanwhile I had to upgrade again to My pom.xml
|
@olegz find the repo here: https://github.com/ziodave/spring-cloud-stream-issue-2056 I am using Azure Service Bus, if you'd like I can give you a temporary end-point to use for testing. POJOs are really simple (just one single
This doesn't happen with spring-cloud-function 3.0.10.RELEASE, uncomment the following in pom.xml to quickly switch to that release:
|
I have confirmed what @ziodave has said. When I use spring-cloud-function 3.0.10.RELEASE the deserialization issue goes away and when I use 3.0.11.RELEASE the issue happens. Thankyou ziodave! |
Guys, I am still struggling to reproduce it. I just added another test with the last commit on 3.0.x branch and all is good. The project that was shared by @ziodave . . I am not even sure where to begin as I was expecting some bare minimum but it appears to be a full blown project. |
@olegz it's only one file: https://github.com/ziodave/spring-cloud-stream-issue-2056/blob/main/src/main/java/com/example/demo/pojo/PojoConfiguration.java with the following configuration:
|
@ziodave then my last commit does exactly that. What am I missing? |
@olegz we experienced the issue with 3.0.11.RELEASE. Are you testing with 3.0.13.BUILD-SNAPSHOT, maybe it has in fixed already in 3.0.13.BUILD-SNAPSHOT? |
Yes, I am sorry. The tests that I added are based on the current snapshots. But I forgot yo mention that last week we had a release of both functions and stream (due to customer support issue). The issue was addressed before the release so it is available to you. Let me know |
Horsham.SR10 (3.0.10.RELEASE) for me brings s-c-function 3.0.11.RELEASE. |
I think this depends from the fact that Spring Cloud Function is a dependency of spring-cloud-dependencies-Hoxton.SR9.pom, not of spring-cloud-stream-dependencies-Horsham.SR10.pom.
To bring s-c-function 3.0.12.RELEASE this is what I did, please let me know if it's correct:
|
Yes, this is correct since this was an independent release outside of Hoxton. In other words there is no corresponding release of spring-cloud, which is really not a requirement since we have our own BOM (as reflected on the project site), but we try as much as we can to match the releases for user convenience. Anyway, should I assume the issue is resolved? |
I still got Null, but I'll have to run a more thorough check. |
Sure, please let me know so we have enough time to address it for the next release |
We are experiencing the same problem. Is there any update on that? |
@lenagainulina which s-c-function version you are using? You may need to explicitly identify 3.0.12.RELEASE. |
Hi @olegz and sorry for the delayed response. Originally I was using 3.0.11.RELEASE, I tried switching to 3.0.12.RELEASE, but it didn't solve the issue for me, message payload was deserialized with null values. I've described my case here with a minimal example: https://stackoverflow.com/questions/65297525/spring-cloud-stream-functional-approach-message-conversion-produces-an-object-w . The difference from the case described above is that I'm using kafka binder.
|
I guess it was combination of work in both s-c-function and s-c-stream that fixed the issue. |
I am using the 3.0.9 release and have came across a bug.
I am trying to receive a message using rabbitmq as the bindier.
I have a reactive function
@Bean
public Function<Flux<MyMessage>, Mono<Void>> consumer() {
return myMessages -> myMessages.flatMap(m -> Mono.fromCallable(() -> {
// In my actual application, I am doing a synchronous blocking task here. I am not just logging
log.info("My val -> {}", m.getVal()); // val is null
return null;
}).subscribeOn(Shedulers.elastic())).then();
}
The problem is MyMessage val is null.
When I try using the Consumer function I do see the value
@Bean
public Consumer<MyMessage> consumer() {
return m -> {
log.info("My val -> {}", m.getVal()); // val is as expected
};
}
It seems that the reactive consumer function is not deserializing the message correctly.
The text was updated successfully, but these errors were encountered: