How to get String from Mono in reactive java

前端 未结 6 1844
鱼传尺愫
鱼传尺愫 2020-12-09 04:01

I have a method which accepts Mono as a param. All I want is to get the actual String from it. Googled but didn\'t find answer except calling block() over Mono object but it

6条回答
  •  时光说笑
    2020-12-09 04:30

    According to the doc you can do:

    String getValue(Mono mono) {
        return mono.block();
    }
    

    be aware of the blocking call

提交回复
热议问题