【发布时间】:2021-08-12 07:09:22
【问题描述】:
工作
WebClient webClient = WebClient.create("https://fcm.googleapis.com/fcm/send");
return webClient.post()
.uri("")
.header("Authorization", "key=test")
.bodyValue("")
.retrieve().bodyToMono(String.class).block();
不工作
WebClient webClient = WebClient.create("https://fcm.googleapis.com/fcm/send");
return webClient.post()
.uri("")
.header("Authorization", "key=test")
.bodyValue("")
.retrieve();
如何更改我的代码? 我不想使用该块。
【问题讨论】:
-
我们需要更多上下文,什么应用程序是纯 webflux 应用程序还是 web 应用程序。调用它的代码是什么样的?您阅读过 reactor 入门文档吗?
-
这是一个调度器。
-
请再次阅读我的评论,我问了几个问题
this is a scheduler不是我任何问题的答案。 -
这是一个 Web 服务器,正在打开服务器上的调度程序。我不太明白是纯webflux应用还是web应用的意思。我用它作为服务器,但我不知道服务器属于哪个区域。我不是服务器开发人员,但我正在编写服务器代码,所以我不擅长基础知识。我没有老板,所以我没有人可以问。
-
你调用的代码是``` @Scheduled(fixedDelay = 60000) public void init() throws Exception { try { ```
标签: spring-webflux webclient blocking