You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: @ReadOperation on a custom actuator endpoint returning Flux cancels the request after first element, the same code wrapped as a @GetMapping of a @RestController returns full response as expected. The workaround is to return Mono but its a bit weird.
Spring Boot Version 2.6.4 created via initializr with Webflux and Actuator
Expose the specified Publisher with the Mono API, and ensure it will emit 0 or 1 item. The source emitter will be cancelled on the first onNext.
There also appears to be problems with returning Flux when using Spring MVC and Jersey as well.
I can't remember if it was a conscious decision to only support Mono or if it's an oversight. If it was intentional, we should improve the documentation as we don't seem to say anything about supported return types at the moment. If it was an oversight, we'll have to decide if we want to support returning a Flux and, if we do, if we consider adding support to be a bug fix or an enhancement.
Problem:
@ReadOperation
on a custom actuator endpoint returningFlux
cancels the request after first element, the same code wrapped as a@GetMapping
of a@RestController
returns full response as expected. The workaround is to return Mono but its a bit weird.Spring Boot Version 2.6.4 created via initializr with Webflux and Actuator
demo.zip
Code:
Actuator Endpoint
Demonstration Controller:
See sample project attached.
curl localhost:8080 -> 0123456789
curl localhost:8080/actuator/demo -> 0
Expected behavior: 2nd call delivers 0123456789
Log:
The text was updated successfully, but these errors were encountered: