问题标签 [rsocket]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
265 浏览

spring - Spring Integraton RSocket 和 Spring RSocket 交互问题

我创建了一个新示例并将代码滑入客户端和服务器端。

完整的代码可以在这里找到。

服务器端有3个版本。

  • 服务器无 Spring Boot 应用,使用 Spring Integration RSocket InboundGateway。
  • server-boot重用 Spring RSocket autconfiguration,并ServerRSocketConnecter通过ServerRSocketMessageHanlder.
  • server-boot-messsagemapping不使用 Spring Integration,只使用 Spring Boot RSocket autconfiguration,and @Controllerand @MessageMapping

客户端有2个版本。

  • 客户端,使用 Spring Integration Rocket OutboundGateway 发送消息。
  • client-requester使用 发送消息RSocketRequester,根本不使用 Spring Integration。

客户端和服务器交互方式为REQUEST_CHANNEL,通过TCP/localhost:7000连接服务器。

服务器

应用类:

服务器启动

pom.xml 中的依赖项。

应用程序属性

应用类。

服务器启动消息映射

pom.xml 中的依赖项。

应用程序.properties。

应用类。

客户

在客户端,pom.xml中的依赖关系是这样的。

应用类:

在运行客户端和服务器应用程序时,尝试http://localhost:8080/hello通过curl.

当使用使用 InboundGateway 处理消息的serverserver-boot时,输出如下所示。

使用server-boot-messagemapping时,输出正如我所料:

客户请求者

应用类:

运行此客户端和 3 台服务器时,尝试http://localhost:8080/hello通过curl.

当使用使用 InboundGateway 处理消息的服务器服务器启动时,它会引发类转换异常。

使用server-boot-messagemapping时,输出正如我所料:

不知道InboundGateway和OutboundGateway的配置问题出在哪里?

0 投票
2 回答
341 浏览

spring-boot - 使用 spring boot rsocket 捕获取消帧类型

我有一个 spring boot rsocket 实现,如果客户端取消或关闭他们的 rsocket 请求,那么我想取消服务器上的其他订阅注册。

在 Spring Boot 服务器上的日志中,我可以看到发送或接收了一条取消消息:

如何捕获和处理此取消信号?

我尝试取消端点,但这些没有捕获信号:

或者

这个关于取消订阅的问题可能是相关的,这个关于检测 websocket 断开连接的问题

0 投票
0 回答
96 浏览

java - 配置 Springboot Jaeger 和 RSocket

我有 Springboot Webflux 主应用程序,它使用 RSocket 与其他服务通信,我想配置堆栈,所以我想看到如下所示的跟踪:

今天我需要检查每个应用程序以检查流程

我正在使用实现'io.opentracing.contrib:opentracing-spring-jaeger-cloud-starter'依赖

如何将 opentracing (jaeger) 与 RSocket 集成?我看到对于 WebClient,您有自动配置,但除了Tracking-Zipkin页面之外几乎没有或没有找到关于如何执行此操作的说明,我真的不知道如何从中进行处理。

0 投票
0 回答
149 浏览

java - 为什么我们不能将 RSocket 与 Apache Tomcat 一起使用?

我知道 Tomcat 支持 WebSocket,所以我认为 RSocket 也可以与 Tomcat 一起使用。那么我们是否需要等待实施,或者是否有阻止程序使其成为不可能?

0 投票
2 回答
1821 浏览

websocket - Send message only to certain client using websockets with Rsocket and Spring Webflux

I am trying to use Rsocket with websocket in one of my POC projects. In my case user login is not required. I would like to send a message only to certain clients when I receive a message from another service. Basically, my flow goes like this.

In my case, I am thinking to use a unique id for each connection and each request. Merge both identifiers as correlation id and send the message to Service B and when I get the message from Service B figure which client it needs to go to and send it. Now I understand I may not need 2 services to do this but I am doing this for a few other reasons. Though I have a rough idea about how to implement other pieces. I am new to the Rsocket concept. Is it possible to send a message to the only certain client by a certain id using Spring Boot Webflux, Rsocket, and websocket?

0 投票
2 回答
879 浏览

spring-boot - 从 RSocket-Java 客户端连接到 Spring Boot RSocket 服务器时出错

通过 TCP 连接到 Spring Boot RSocket 应用程序时遇到问题。使用 RSocketRequester 时客户端工作正常,但是当我尝试使用 RSocketFactory 客户端连接时,它不断收到错误。代码如下。

这会产生如下错误:

据我了解,这个特定错误是由于 netty 消息包装(来自stackoverflow 上的其他线程),但如何解决呢?服务器是 Spring Boot 5+ RSocket,但客户端只使用 RSocket-Java。

0 投票
1 回答
247 浏览

spring - 如何在 Spring Boot @MessageMapping 控制器中获取有效负载(io.rsocket.Payload)

我正在从 RSocket-Java 连接到 Spring Boot RSocket 应用程序。在服务器中我有@MessageMapping。如何访问服务器上的 RSocket Payload。

0 投票
1 回答
49 浏览

java - 在 Maven 构建期间包 io.rsocket.core 不存在

我面临一些奇怪的问题。在 Maven 构建期间,我得到了package io.rsocket.core does not exist. 我的pom.xml包含以下依赖项

分析 reactor-core jar 文件显示该 jar 中没有核心包。我错过了一些依赖项吗?

谢谢

0 投票
1 回答
787 浏览

spring-webflux - Rsocket服务器如何向客户端发送消息?以及如何在js中使用Channel?

每个人。

问题 1

我尝试使用 Rsocket。Rsocket服务器如何向客户端发送消息?与 websocket 一样,服务器可以向一个客户端或所有客户端发送消息。我找不到办法。也许我可以使用频道?但我不知道该怎么办。

问题2

我像这样使用频道:

在 js 中,我这样做:

输出:

但是我无法获取MessageMapping频道信息并且channel方法未执行。

我该怎么办?</p>

谢谢!!!

0 投票
1 回答
780 浏览

spring-webflux - 如何使用 RSocket 处理从服务器发送到客户端的消息?

我尝试使用RSocketRequester从服务器向特定客户端发送消息,但我不知道如何在前端处理它。服务器是 Spring Webflux,控制器如下:

在我使用的前端rsocket-js。该sayHello方法工作得很好(请求流),但是当我调用该sayHi方法时,我想从服务器发送两条消息。第一个到say.hello端点,第二个到say.hi端点。我有rsocket-js这样的实现:

我可以在 Google Chrome DevTools -> Network -> rsocket 中看到这两条消息。所以客户端收到了它们,但我无法在代码中捕获RSocketRequester. 似乎服务器使用fireAndForget方法。如何在客户端处理它?