DEV Community

Discussion on: Using the new Azure SDK for Java to upload images asynchronously, using Spring Reactor

Collapse
 
anbusampath profile image
Anbu Sampath

when I tried executing the example with Spring Boot 2.1.8.RELEASE (webflux starter) got below exception. is Azure SDK required minimum reactor-netty verion ? Spring Boot uses different reactor-netter version. I could see only dependency version difference between both.

reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-http-nio-3
Caused by: java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-http-nio-3
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:77) ~[reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]
at reactor.core.publisher.Mono.block(Mono.java:1494) ~[reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]
at com.azure.core.implementation.RestProxy.createResponse(RestProxy.java:456) ~[azure-core-1.0.0-preview.3.jar:na]
at com.azure.core.implementation.RestProxy.lambda$handleRestResponseReturnType$5(RestProxy.java:396) ~[azure-core-1.0.0-preview.3.jar:na]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:107) ~[reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]

Collapse
 
jdubois profile image
Julien Dubois

I don't think this issue is linked to the Netty version - it seems you are doing a blocking call at some point, and that's more likely to be the issue.
Did you change anything in the sample code, or just run it without any modification? I might have done an error when copy/pasting the code at some point.
If you have doubts about the Netty versions, I would use the one from Spring Boot, as it's using it far more extensively so you'll reduce the number of potential issues.

Collapse
 
anbusampath profile image
Anbu Sampath

I haven't modified the code, only I changed boot version to 2.1.8. But it worked as expected on 2.2.0 milestone and snapshot build.