You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
Describe the bug
RSocketAutoConfiguration 中,UpstreamManager 早于 CloudEventsProcessor 实例化。前者初始化时,会创建与 broker 的连接,如果 requester 指定了 p2pService,与 broker 建立连接的同时,broker 会立即推送 ServiceInstancesChangedEvent 给当前 App。但此时 CloudEventsProcessor 尚未实例化,无法消费事件,故 UpstreamManager 无法在应用启动时更新 p2pservice 的相关 cluster。
Environment
在目前使用中,我是通过如下方式暂时规避该问题:
在 requester 的 application.properties 中,除了 p2p-services,同时使用 rsocket.routes[0] 指定服务提供方的路由信息。后续如有新的provider 上线,requester 可以通过 CloudEventsProcessor 消费 ServiceInstancesChangedEvent,完成 UpstreamManager 的更新
rsocket.p2p-services=com.alibaba.user.UserService:1.0.0
rsocket.routes[0].service=com.alibaba.user.UserService
rsocket.routes[0].version=1.0.0
rsocket.routes[0].uris=tcp://localhost:19999
大佬 @linux-china ,不知是否是我的理解有偏差,可有更直接的办法使用 p2p-services,毕竟通过 rsocket.routes[0] 方式,需要提前知晓 provider 的 url 才行
The text was updated successfully, but these errors were encountered: