RSocket

Migrating existing Spring Websocket handler to use rsocket

可紊 提交于 2020-04-30 09:26:08
问题 Suppose I have this simple Websocket handler for chat messages: @Override public Mono<Void> handle(WebSocketSession webSocketSession) { webSocketSession .receive() .map(webSocketMessage -> webSocketMessage.getPayloadAsText()) .map(textMessage -> textMessageToGreeting(textMessage)) .doOnNext(greeting-> greetingPublisher.push(greeting)) .subscribe(); final Flux<WebSocketMessage> message = publisher .map(greet -> processGreeting(webSocketSession, greet)); return webSocketSession.send(message); }

Spring 5 WebFlux server push notifications via RSocket protocol

旧时模样 提交于 2020-03-23 07:55:18
问题 The case is the following: After as clients A and B established connections with a server via RSocket protocol, each of the clients could be notified with their own event(s) ( event A or event B ) to trigger some action on a client ( event X -> action on client X ). Thanks 回答1: You could achieve it with setup payload. Server: @Controller public class ServerController { private static final Map<String, RSocketRequester> REQUESTER_MAP = new HashMap<>(); @ConnectMapping("client-id") void

Spring Boot RSocketRequester deal with server restart

£可爱£侵袭症+ 提交于 2020-03-22 03:49:06
问题 I have a question about Springs RSocketRequester. I have a rsocket server and client. Client connects to this server and requests @MessageMapping endpoint. It works as expected. But what if I restart the server. How to do automatic reconnect to rsocket server from client? Thanks Server: @Controller class RSC { @MessageMapping("pong") public Mono<String> pong(String m) { return Mono.just("PONG " + m); } } Client: @Bean public RSocketRequester rSocketRequester() { return RSocketRequester

Spring Boot RSocketRequester deal with server restart

…衆ロ難τιáo~ 提交于 2020-03-22 03:49:02
问题 I have a question about Springs RSocketRequester. I have a rsocket server and client. Client connects to this server and requests @MessageMapping endpoint. It works as expected. But what if I restart the server. How to do automatic reconnect to rsocket server from client? Thanks Server: @Controller class RSC { @MessageMapping("pong") public Mono<String> pong(String m) { return Mono.just("PONG " + m); } } Client: @Bean public RSocketRequester rSocketRequester() { return RSocketRequester

Spring Integraton RSocket and Spring RSocket interaction issues

妖精的绣舞 提交于 2020-03-03 14:01:31
问题 I created a new sample and slipted the codes into client and server side. The complete codes can be found here. There are 3 version of server side. server None Spring Boot app, using Spring Integration RSocket InboundGateway. server-boot Reuse Spring RSocket autconfiguration, and created ServerRSocketConnecter through ServerRSocketMessageHanlder . server-boot-messsagemapping Not use Spring Integration, just use Spring Boot RSocket autconfiguration, and @Controller and @MessageMapping . There

Rsocket Server exception: No handler for destination '' (destination does not pass from client to server)

主宰稳场 提交于 2020-01-04 01:55:34
问题 I wrote a little demo for RSocket message The problem is that I am unable to access the Rsocket endpoint, I get the following exception from the server: The Client-side: configuration: @Bean RSocket rSocket() { return RSocketFactory.connect() .mimeType(MimeTypeUtils.APPLICATION_JSON_VALUE, MimeTypeUtils.APPLICATION_JSON_VALUE) .frameDecoder(PayloadDecoder.ZERO_COPY) .transport(TcpClientTransport.create(new InetSocketAddress(7500))) .start() .block(); } @Bean RSocketRequester requester

Stateful Rsocket Application

£可爱£侵袭症+ 提交于 2019-12-23 14:18:41
问题 in my project I want to have multiple clients connecting to a service. I am using the java Rsocket implementation. The service should maintain a state for each client. Now at this point I either can manage the clients by some identifier. This option I have already implemented. But I do not want to manage the session manually using strings. So another idea is to identify the clients by the Rsocket connection. Is there a way to use Rsocket channel for identification of a specific client?

重磅来袭!Reactive 架构专场四城巡回演讲

孤街醉人 提交于 2019-12-09 21:05:16
Reactive 究竟是什么?Reactive 对架构设计的影响和冲击,以及给开发方式带来的改变有哪些?为什么阿里巴巴、Pivotal、Facebook 纷纷在生产环境中实践 Reactive? 本次的四城巡演活动中,我们请到了著名的 JAVA 布道师 JoshLong、阿里巴巴 P9 雷卷以及 Netifi CTO Ryland Degnan 等国内外大牛现场为你解答以上疑问! 活动亮点 著名 Java 布道师 Josh Long(龍之春)现场详解如何使用 Reactor、RSocket 进行编程以及 Spring Gateway 等 Spring 新特性; 阿里巴巴资深专家雷卷讲述阿里云上如何接入和使用 RSocket Broker? Netifi CTO 将对 RSocket 进行全面介绍,包括 RSocket broker 的实现和功能以及 RSocket 等内容。 活动详情 北京场 时间:11 月 21 日 16:30-20:20 预约直播链接: https://developer.aliyun.com/live/1650 报名方式: 戳我报名 杭州场 时间:11 月 22 日 13:30-17:55 预约直播链接: https://developer.aliyun.com/live/1651 报名方式: 戳我报名 深圳场 时间:11 月 23 日 13:00-16:50

阿里雷卷:Reactive 基金会的成立将对开发方式带来哪些影响?

爱⌒轻易说出口 提交于 2019-12-09 17:34:02
作者 | 赵钰莹 近日,Linux 基金会宣布成立 Reactive 基金会。对于 Reactive,各位开发者应该并不陌生,尤其是 Node.js 开发者,但真正了解并意识到这件事情对开发方式带来的影响的恐怕不多。本文,InfoQ 有幸第一时间对推动阿里巴巴成为该基金会初创成员的阿里巴巴资深技术专家雷卷进行了独家采访,进一步全面了解 Reactive 基金会的成立背景及其对开发方式的发展推动。 Reactive 基金会是什么? 近日,Linux 基金会 宣布启动 Reactive 基金会,旨在加速发展构建下一代网络应用程序的架构。该基金会由阿里巴巴、Facebook、Lightbend、Netifi 和 Pivotal 等初始成员组成。涉及成功的开源规范 Reactive Streams 和 RSocket,以及编程语言实现。 虽然 Reactive 基金会刚刚成立,但 Reactive,也就是开发者常说的响应式编程,已经发展多年。2011 年,Reactive 就开始步入大众视野, 当时微软在 .Net Framework 4.0 中内置了Reactive 支持,称之为 Reactive Extensions。2013 年,广大 Java 开发者熟知的 RxJava 发布。接下来,Reactive 进入飞速发展阶段,先后出现了 RxRuby、RxJS(感兴趣的开发者可以访问

提升不止一点点,Dubbo 3.0 预览版详细解读,还愣着干啥啊?进来啊

北战南征 提交于 2019-12-05 08:21:05
Dubbo 自 2011 年 10 月 27 日开源后,已被许多非阿里系的公司使用,其中既有当当网、网易考拉等互联网公司,也不乏中国人寿、青岛海尔等大型传统企业。 自去年 12 月开始,Dubbo 3.0 便已正式进入开发阶段,并备受社区和广大 Dubbo 用户的关注,本文将为您详细解读3.0 预览版的新特性和新功能。 下面先解答一下两个有意思的与 Dubbo 相关的疑问。 · 为什么 Dubbo 一开源就是 2.0 版本?之前是否存在 1.0 版本? 笔者曾做过 Dubbo 协议的适配兼容,Dubbo 确实存在过 1.x 版本,而且从协议设计和模型设计上都与 2.0 的开源版本协议是完全不一样的。下图是关于 Dubbo 的发展路径: · 阿里内部正在使用 Dubbo 开源版本吗? 是的,非常确定,当前开源版本的 Dubbo 在阿里巴巴被广泛使用,而阿里的电商核心部门是用的 HSF2.2 版本,这个版本是兼容了 Dubbo 使用方式和 Remoting 协议。当然,我们现在正在做 HSF2.2 的升级,直接依赖开源版本的 Dubbo 来做内核的统一。所以,Dubbo 是得到大规模线上系统验证的分布式服务框架,这一点毋容置疑。 Dubbo 3.0 预览版的要点 Dubbo 3.0 在设计和功能上的新增支持和改进,主要是以下四方面: · Dubbo 内核之 Filter 链的异步化