-
Notifications
You must be signed in to change notification settings - Fork 613
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
blocking call with spring webflux #2192
Comments
I think you are miss-interpreting reactive support in spring-cloud-stream. At the moment it's API only. We can't avoid blocking calls since underlying binders are relying on non-reactive APIs (Kafka, Rabbit etc). So effectively we provide a reactive bridge to an established messaging frameworks which is what you see in the above stack trace. |
I did a workaround with separate threads for netty and reactor when sending a message to kafka. return client.post()
.uri("/bar")
.bodyValue(body)
.retrieve()
.bodyToMono(String.class)
.doOnNext(response -> LOGGER.warn("Receive response {} in netty thread", response))
.publishOn(Schedulers.boundedElastic()); The error is not reproduced on this configuration. How good is this solution? |
This appears top be not related to s-c-stream so I am going to close this. Feel free to raise a new issue with an updated version of the framework |
spring-cloud-stream with the reactive programming model makes the blocking call on the reactor netty thread while fetching metadata from kafka.
You can see this with BlockHound tool.
BlockHound output is:
To reproduce this issue run the test from DemoAppTest placed here demo project
spring-boot version - 2.5.2
spring-cloud-stream version - 2020.0.3
The text was updated successfully, but these errors were encountered: