dstarcev
02/08/2018, 9:03 AMmono
function? In the example above context.getPrincipal<Principal>()
retrieves data from Context
@RestController
class ProfileResource {
// this works well
@GetMapping("/profile/classic")
fun classic(context: ServerWebExchange): Mono<String> =
context.getPrincipal<Principal>()
.map { c -> c.name }
// this throws "No value received via onNext for awaitFirst"
@GetMapping("/profile/coroutine")
fun coroutine(context: ServerWebExchange) = mono {
context.getPrincipal<Principal>()
.awaitFirst().name
}
}