请问是否有现成的使用 WebFlux、RSocket 和 Spring(或SpringBoot) 的 CRUD 示例?
我已经阅读了 RSocket 文档,学习了 WebFlux ,也写了自己的简单示例,但我想看到一个真正使用基本方法的 RSocket 的CRUD应用程序。
非常感谢!
请问是否有现成的使用 WebFlux、RSocket 和 Spring(或SpringBoot) 的 CRUD 示例?
我已经阅读了 RSocket 文档,学习了 WebFlux ,也写了自己的简单示例,但我想看到一个真正使用基本方法的 RSocket 的CRUD应用程序。
非常感谢!
@Controller
来处理这样的消息。@Controller
class ProfileController {
@MessageMapping("fetch.profile.{name}")
public Mono<Profile> greet(@DestinationVariable String name) {
}
@MessageMapping("create.profile")
public Mono<Message> greet(@Payload CreateProfileRequest p) {
}
@MessageMapping("update.profile.{name}")
public Mono<Message> greet(@DestinationVariable String name, @Payload UpdateProfileRequest p) {
}
@MessageMapping("delete.profile.{name}")
public Mono<Message> greet(@DestinationVariable String name) {
}
}
RSocketRequester
与服务器端进行交互,如下所示。//fetch a profile by name
requester.route("fetch.profile.hantsy").retrieveMono()
//create a new profile
requester.data(new CreateProfileRequest(...)).route("create.profile").retrieveMono()
//update the existing profile
requester.data(new UpdateProfileRequest(...)).route("update.profile.hantsy").retrieveMono()
//delete a profile
requester.route("delete.profile.hantsy").retrieveMono()