rsocket-sample | RSocket sandbox | Reactive Programming library
kandi X-RAY | rsocket-sample Summary
kandi X-RAY | rsocket-sample Summary
RSocket sandbox
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initializes the data .
- Setup the connect handler .
- Configure the rsocket interceptor .
- The initializer bean .
- Downloads a file from a URL .
- Initialize the transport .
- Get uppercase
- Sends a greeting channel .
- Update a post .
- Add custom RTSocketRequester .
rsocket-sample Key Features
rsocket-sample Examples and Code Snippets
Community Discussions
Trending Discussions on rsocket-sample
QUESTION
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
throughServerRSocketMessageHanlder
. - server-boot-messsagemapping Not use Spring Integration, just use Spring Boot RSocket autconfiguration, and
@Controller
and@MessageMapping
.
There are 2 versions of client.
- client, Sending messages using Spring Integration Rocket OutboundGateway.
- client-requester Send messages using
RSocketRequester
, not use Spring Integration at all.
The client and server interaction mode is REQUEST_CHANNEL, and connect server via TCP/localhost:7000.
server ...ANSWER
Answered 2020-Mar-02 at 17:52Thank you for such a detailed sample!
So, what I see. Both clients (plain RSocketRequester
and Spring Integration) work well with plain RSocket server.
To make them working with Spring Integration server you have to do this changes:
- The server side:
Add .requestElementType(ResolvableType.forClass(String.class))
into an RSockets.inboundGateway()
definition, so it will know to what to convert an incoming payloads.
The client side:
.data(Flux.just("a\n", "b\n", "c\n", "d\n"))
.
Currently the server side of Spring Integration doesn't treat an incoming Flux
as a stream of independent payloads. So, we try to connect all of them into a single value.
The new line delimiter is an indicator that we expect independent values. Spring Messaging on its side does exactly opposite: it checks for multi-value
expected type and decode every element in the incoming Flux
in its map()
instead of an attempt for the whole Publisher
decoding.
It's going to be kinda breaking change, but possibly need to consider to fix RSocketInboundGateway
logic to be consistent with regular @MessageMapping
for RSocket support. Feel free to raise a GH issue!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rsocket-sample
You can use rsocket-sample like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the rsocket-sample component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page