-
Is there a way to achieve result types like Mono<ResponseEntity<SomeBean>> instead of ResponseEntity<Mono<SomeBean>> I need to set header properties in the response (e.g. Etag) which depend on the result processing (SomeBean). map:
result: org.springframework.http.ResponseEntity
single: reactor.core.publisher.Mono
multi: reactor.core.publisher.Flux |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I understand that this will not work because the return ResponseEntity.ok ()
.eTag("foo")
.body (result of SomeBean); which is a and you would like to do something like this: return someBean.getResult()
.map(r -> ResponseEntity.ok()
.eTag(r.getEtag())
.body(r)); which is a There is currently no official feature to switch the order of Anyway, there are two workarounds
|
Beta Was this translation helpful? Give feedback.
I understand that this will not work because the
eTag()
depends on the result ofSomeBean
:which is a
ResponseEntity<Mono<SomeBean>>
and you would like to do something like this:
which is a
Mono<ResponseEntity<SomeBean>>
There is currently no official feature to switch the order of
Mono
/ResponseEntity
.Anyway, there are two workarounds
Object
workaroundthis uses official featu…