Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Oleh Dokuka
    @OlegDokuka
    right now it is 1.1.0
    thus, it should not be the case anymore except you experienced it and has some example to reproduce it
    KamiWan
    @KaimingWan
    @OlegDokuka Thanks. It should be a spring-rsocket issue that their acceptor method annotated by @ConnectMapping can't return a RejectedSetupException because the Mono<Void> return type. I will put forward a issue for spring later.
    KamiWan
    @KaimingWan
    @OlegDokuka I put forward a stackoverflow question about the related spring-rsocket issue. You can check the question if you are interested, thanks. Related url is : https://stackoverflow.com/questions/65772456/does-spring-rsocket-support-return-a-rejectedsetupexception-in-connectmapping-a
    11 replies
    Stanislav Zemlyakov
    @rcd27
    Hi guys, trying to run spring-rsocket-sample and getting io.rsocket.exceptions.RejectedSetupException: Access Denied when firing request with RSocket Client CLI. This error seems to be on server-side. Have anyone done this tutorial?
    2 replies
    Pavel Grigorenko
    @MastaP
    Hi, I have a question about metadata length in rsocket frame. We had an issue in staging env which was not reproducible locally until we realised the only difference was in length of the string values that were passed via routing variables (spring messaging), but the error was seemengly unrelated to the root cause:
    io.rsocket.exceptions.ApplicationErrorException: No handler for destination ‘’
    So the question is: the metada length limit is defined in protocol specification, the actual metadata size is also known at runtime, why does this have to fail in such an obscure way instead of rejecting the request attempt with a readable and relatable exception?
    42 replies
    viniljose
    @viniljose
    Hi i have a usecase where there is a (non rsocket )Socket Server pushing messages in TCP with ip and port. I need to write a listener to process this as a socket client. I am wondering is it possible to listen and process using RSocket client(considering server is non-rsocket)? As far as i know client and server needs to communicate using RSocket protocol. please confirm
    8 replies
    viniljose
    @viniljose
    No its an actual Tcp server. client ip and port is whitelisted
    Dmitri Maximovich
    @maximdim_twitter

    Hi. I have a question - how do I tell RSocket to establish the connection (call the setup route endpoint) without invoking any of the other endpoints?

    RSocketRequester requester = builder
      .setupRoute("/connect")
      .setupData(agentId)
      .rsocketConnector(connector -> connector.reconnect(Retry.fixedDelay(Integer.MAX_VALUE, Duration.ofSeconds(1))))
      .dataMimeType(MediaType.APPLICATION_JSON) 
      .transport(WebsocketClientTransport.create(httpClient, "/rsocket"));

    At this point connection is not actually established. How do I force it to connect to the backend?

    Thanks.

    35 replies
    Dmitri Maximovich
    @maximdim_twitter

    Hi. Question about shutting down Spring context with Flux.interval() running.

    I have the following code that pushes telemetry over RSocket at a given interval.

    @Component
    public class BackendService {
        private final Logger logger = LoggerFactory.getLogger(getClass());
    
        private final String id = "test1";
        private final String backendUrl = "ws://localhost:9898";
    
        private final RSocketRequester requester;
        private final Disposable telemetrySubscriber;
    
        @PreDestroy
        public void destroy() {
            telemetrySubscriber.dispose();
        }
    
        public BackendService(RSocketRequester.Builder builder, RSocketStrategies strategies) {
            logger.info("id: {}, backend URL: {}", id, backendUrl);
    
            HttpClient httpClient = HttpClient.create()
                    .baseUrl(backendUrl);
    
            requester = builder
                    .setupRoute("/backend/connect")
                    .setupData(id)
                    .rsocketConnector(connector -> connector.reconnect(Retry.fixedDelay(Integer.MAX_VALUE, Duration.ofSeconds(1))))
                    .dataMimeType(MediaType.APPLICATION_JSON)
                    .transport(WebsocketClientTransport.create(httpClient, "/rsocket"));
    
            telemetrySubscriber = Flux.interval(Duration.ofSeconds(10))
                .onBackpressureDrop()
                .map(tick -> "Telemetry from " + id + " tick " + tick)
                .as(flux -> requester.route("/backend/telemetry").data(flux).retrieveFlux(Void.class))
                .subscribe();
    
        }
    
    }

    It works fine in general, but I have noticed that when I shut down Spring Context where this Component is defined, it doesn't shut down completely - there is a bunch of reactor threads that are still running (e.g. reactor-http-nio-X etc) and it seems that Flux.interval() is still active. The following exception is being printed at the given interval:

    java.util.concurrent.RejectedExecutionException: event executor terminated
        at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:926) ~[netty-common-4.1.58.Final.jar:4.1.58.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:353) ~[netty-common-4.1.58.Final.jar:4.1.58.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:346) ~[netty-common-4.1.58.Final.jar:4.1.58.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:828) ~[netty-common-4.1.58.Final.jar:4.1.58.Final]

    The complete code is here: https://github.com/maximdim/rsocket2/blob/lifecycle/src/main/java/rsocket/client/BackendService.java

    I would appreciate any hints. Thanks!

    37 replies
    Oleh Dokuka
    @OlegDokuka
    image.png
    Navid Ghahremani
    @ghahramani
    rsc.png
    Hey guys, something strange is happening. When I deploy my code, the rsocket server started having strange behaviour, please check the screenshot, it shows me No Handler exception sometimes maybe around 50% of time.
    13 replies
    sorry for the masks
    Dmitri Maximovich
    @maximdim_twitter

    @OlegDokuka I have a conceptual question about Rsocket and security. I'm aware that there is a spring security for rsocket but let's assume that for my use case it's an overkill. I want to pass credentials as part of the setup route and do authentication in the @ConnectMapping handler:

    @ConnectMapping 
    Mono<Void> handleSetup(@Payload String payload) {
       boolean isAuthenticated = ... //my authentication code.
       if (!isAuthenticated) {
         return Mono.error(new RejectedSetupException("connection is not authenticated"));
       }
       ...

    Now what should I do to access to the caller's identity in the regular @MessageMapping handler? I don't want to rely on anything that client passes into that handler as authentication is already happened in the @ConnectMapping but I still need to know the caller's identity somehow. It's part of the same connection after all.

    Thanks!

    39 replies
    bruto1
    @bruto1
    A great read: https://jauntsdn.com/post/rsocket-million-streams-2/ — is Maksym doing anything with these findings? I see no commit or PR from him in this repo or his own fork
    6 replies
    Oleh Dokuka
    @OlegDokuka
    @bruto1 thanks for sharing. Just in a few words - this blogpost does not represent any reality related to the current RSocket-Java state and is based on the outdated 0.9.x impl
    Also, this person does not represent RSocket-Java community nor RSocket org and his view is his own openion and what he writes is his own fork unrelated to the official effort
    We have different view and plans on the rsocket-java and community development in general
    bruto1
    @bruto1
    My mistake! Figured it was relevant because the post is recent
    Josiah Noel
    @SentryMan
    Screenshot (2)_LI.jpg
    Hey Lads, I'm wondering if someone can help me out. Is there a way to prevent the simple auth metadata from showing up in clear like this?
    2 replies
    Josiah Noel
    @SentryMan
    @OlegDokuka on an unrelated note, is there any benefit to running rsocket over WebSocket vs over TCP directly?
    2 replies
    Jacob Tonna
    @Jtonna__twitter

    Hopefully this is the right place to ask for help with this. Im having troubles connecting my Server (hosted on Heroku) from my local Shell Client.
    In my server logs everything starts up normally as expected as it says

    2021-02-26T21:16:22.837212+00:00 app[web.1]: 2021-02-26 21:16:22.836  INFO 4 --- [           main] o.s.b.rsocket.netty.NettyRSocketServer   : Netty RSocket started on port(s): 7000

    When i try to connect from my shell client i get the following error

    Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection timed out: no further information: nuchess-lobby.herokuapp.com/52.72.160.125:7000

    Heres a pastebin with the full log: https://pastebin.com/gi05zu9r

    Heroku claims to support Websocket (not TCP) on their free tier so i configured the server to use WS instead of TCP and both clinets connect to the WS port properly locally. So im not sure what im missing here.

    When the connection fails in my shell client theres no error or anything of that kind in the server logs either.

    42 replies
    KamiWan
    @KaimingWan
    @OlegDokuka I put forward a issue in github's spring repository. Are you familar with spring-rsocket? Would you mind having a look at that issue here : spring-projects/spring-boot#25465
    11 replies
    Dmitri Maximovich
    @maximdim_twitter
    @OlegDokuka Hi Oleg, could you recommend the approach for per-request logging for the Spring WebFlux + rSocket project? Our typical use case is when request comes to the WebFlux REST endpoint, processed and sent over rSocket, then response handled and returned. We're looking at something which would function like classic MDC logging - when we would generate a unique id at the time when request arrives and then all log messages (logback) would include such id automatically. Is there any examples or documentation I can look at? Thanks.
    2 replies
    Johannes Edmeier
    @joshiste

    Is there symmetrical support for keepAlive? the spec says

    Unsigned 31-bit integer of Time (in milliseconds) that a client will allow a server to not respond to a KEEPALIVE before it is assumed to be dead

    but I wonder if also the server can use this wether to tell if a certain client is dead? Any Idea how to solve this (without reimplementing keep alive myself using payloads)

    There is a deprecated ServerKeepAliveSupport but that's all i found on this topic...

    currently if the client dies the server doesn't notice.

    11 replies
    Eugene Kuleshov
    @ekuleshov
    @OlegDokuka question about encoding payloads when going from spring-messaging (e.g. org.springframework.messaging.rsocket.RSocketRequester) to rscocket transport.
    As far as I can see all encoders/reactive encoders (e.g. AbstractJackson2Encoder) have either the data payload or the metadata, but not both.
    I need to implement an encoder that needs access to the data (encoded bytes/string) and after processing or encoding original data that data it would need to add some stuff derived from the encoded data into the request's metadata. For example, signature/hmac for the data content in order to guard from man in the middle scenarious.
    Any suggestions?
    I think I see how to intercept both in RSocketProxy, but there I'd need to decode both data and metadata and encode them again (so, kinda too late), so that is not ideal.
    12 replies
    Johannes Edmeier
    @joshiste
    This message was deleted
    Ivan Franchin
    @ivangfr

    Hi guys! I've been working on this project https://github.com/ivangfr/springboot-rsocket-webflux-aop where I use rsocket.

    The project is composed with 2 clients (movie-client-shell and movie-client-ui) and one server (movie-server).

    One problem that I see in my solution is that, once the server restarts, the client movie-client-ui doesn't connect to it anymore. For sure, I need to configure some retry mechanism.

    How could I implement it in this class https://github.com/ivangfr/springboot-rsocket-webflux-aop/blob/master/movie-client-ui/src/main/java/com/mycompany/movieclientui/config/MovieServerRSocketConfig.java#L54?

    Thanks in advance!

    19 replies
    Oleh Dokuka
    @OlegDokuka

    Hi @OlegDokuka , 1 quick question. Currently is there any in-built support to find idle connections and dispose?
    by idle connection i mean the keep alive passes, but the requester has not sent any requests for a while like 5 mins. something like that.

    Sorry, accidentially clicked report butten and the message dissapeared 🤦‍♂️🙇‍♂️

    As of now, we do not have a built-in functionality to detect idle connections, however, you may do that on your own with the support https://github.com/rsocket/rsocket-java/blob/master/rsocket-core/src/main/java/io/rsocket/plugins/RequestInterceptor.java
    4 replies
    olivier dufour
    @dufoli
    hello @OlegDokuka , I do not know if it is the best place to talk about rsocket-rpc-java , anyway, I am currently starting to work on an extension for quarkus for rsocket. I am not using rsocket extension just code in open source project to discover new tech and enjoy coding ;-) I have already done soap extension on quarkus with cxf. So I am switching to new challenge. here is the issue on quarkus : quarkusio/quarkus#1997 and here is my extension https://github.com/dufoli/quarkus-rsocket . Currently, I just use rsocket but I want to decode/encode automatically with media type. I see that the project https://github.com/rsocket/rsocket-rpc-java do this kind of stuff but is there any tutorial or article to help me to understand how to glue it in quarkus. I want to reuse the micro profile produce and consume with mediatype annotation to select the encoder/decoder.
    51 replies
    Josiah Noel
    @SentryMan
    Hey Guys, do you guys know how to set up Resuming properly on a client/server?
    4 replies
    -
    Vinoth Selvaraj
    @vinsguru
    Hi @OlegDokuka , 1 question. Currently connection setup seems to be a lazy process. We do that as part of 1 first req. Is there any option to make that happen eagerly?
    1 reply
    olivier dufour
    @dufoli
    hello @OlegDokuka , I was thinking to custom mimetype, why not add to protocole in metadata a wellKnownmimeType named CustomMimeType then composite metadata can contain this mime id and payload metadata is a string which is more flexible than id for mime. wdyt ? example: application/custom-mimetype 0x2B then metadata payload will contain application/MyFormat for example...
    2 replies
    batlogs
    @batlogs
    hi folks
    is there a spring boot implementation of file upload using Rsocket?
    12 replies
    batlogs
    @batlogs
    I am using java 8
    @vinsguru hi
    @vinsguru I am using your example https://www.vinsguru.com/rsocket-file-upload-example/, where the test is passing, but the file upload to 'output' is not getting done.
    batlogs
    @batlogs
    @vinsguru the only change is I am running this on Java 8, and have changed the 'var' declaration to Object in the controller
    p4w4n
    @p4w4n
    Hey, I am quite new to RSocket and I am trying to work on a POC. The use case I am working on needs to have a one to many connections between client and server. I have a single client which will be connecting with multiple servers with a request stream connection. Every server will send some information to the client. Client will need to aggregate all the information and log it. If an example implementation can be provided it will be of great help. Thanks!!!! :)
    p4w4n
    @p4w4n

    Hey, I am quite new to RSocket and I am trying to work on a POC. The use case I am working on needs to have a one to many connections between client and server. I have a single client which will be connecting with multiple servers with a request stream connection. Every server will send some information to the client. Client will need to aggregate all the information and log it. If an example implementation can be provided it will be of great help. Thanks!!!! :)

    @OlegDokuka Hey Oleg, is this something you can help with or advise. I basically needs a stream between a client and multiple servers. After the client send a request all the servers will start a stream of information to the client. Any help or pointer in the right direction is appreciated. :)

    15 replies
    Eugene Kuleshov
    @ekuleshov
    Can someone give some pointers how to resolve "payload is too big" error?
    An rsocket client is sending about 52mb payload response back to rsocket server (running in a Spring boot) and it chokes somewhere with that error.
    It also says "Consider enabling fragmentation". Any clue how to do that?
    12:25:02.285 ERROR [correlationId=test123][reactor-http-nio-4] HttpExceptionHandler - Unhandled exception: CanceledException: THE PAYLOAD IS TOO BIG TO BE SEND AS A SINGLE FRAME WITH A MAX FRAME LENGTH 16777215. CONSIDER ENABLING FRAGMENTATION.
    io.rsocket.exceptions.CanceledException: The payload is too big to be send as a single frame with a max frame length 16777215. Consider enabling fragmentation.
        at io.rsocket.exceptions.Exceptions.from(Exceptions.java:80)
        Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
    Error has been observed at the following site(s):
        |_ checkpoint ⇢ Handler og.some.spring.controller.SomeController#execute(params) [DispatcherHandler]
    Stack trace:
            at io.rsocket.exceptions.Exceptions.from(Exceptions.java:80)
            at io.rsocket.core.RSocketRequester.handleFrame(RSocketRequester.java:255)
            at io.rsocket.core.RSocketRequester.handleIncomingFrames(RSocketRequester.java:205)
            at reactor.core.publisher.LambdaSubscriber.onNext(LambdaSubscriber.java:160)
            at io.rsocket.core.ClientServerInputMultiplexer$InternalDuplexConnection.onNext(ClientServerInputMultiplexer.java:248)
            at io.rsocket.core.ClientServerInputMultiplexer.onNext(ClientServerInputMultiplexer.java:132)
    Eugene Kuleshov
    @ekuleshov

    Never mind. Found the RSocketRequester.Builder.rsocketConnector(customizer -> customizer.fragment(65536))

    The odd part that connection quietly didn't work with value >64k...

    30 replies
    Braffolk
    @Braffolk
    Ive run into an odd issue. We send JSON data from a front end client to backend. Backend uses spring. Odd thing is that on larger requests the whole JSON doesnt make its way into the backend. The JSON parser errors, but theres no error on rsocket part. I tried playing around with fragment lengths and max payload length, but that didnt seem to help. The message is still being cut. And it seems that the frontend also sends data correctly - in chrome networking tab the message is intact. What could be the culprit here?
    17 replies
    CKATEPTb
    @CKATEPTb_gitlab
    @OlegDokuka, Hello! I watched your report about RSocket (jpoint 2019 on YouTube), hoping to find an answer to my question, but unfortunately I did not find it there. But I learned a lot of interesting things from this report for myself. You are a great fellow, it was interesting to listen to your work, you presented it well, thank you! As you may have guessed, I am writing here for a reason. Now I am making a website for self-education purposes and would like to implement a simple chat on it using rsocket. The problem I ran into is spring rsocket security, the task I set for myself was to bind rsocket to websecurity authorization in spring, but I can't do it = (. Could you help me with that? Show a couple of examples or explain what to do?
    Dmitri Maximovich
    @maximdim_twitter
    @OlegDokuka Hi Oleg. We run into an issue with reactor Context and RSocket send(). In our Spring Boot WebFlux app (boot version 2.4.3) we have a WebFilter that generates a random 'correlation id' per request and places it into reactor Context so it can get logged at the various stages of the request processing. As part of the processing the code executes RSocket operations to the remote server (via websocket). correlation id is passed as part of the RSocket metadata so to use it for logging on the remote server. It all works fine with request-response type calls (retrieveMono()) but when we try to use FnF (send()) - the remote gets the correlation id fine, but after the send() it looks like the Context on the caller side is loosing the correlation id property (all properties perhaps). Literally only change in the code is from requester.route(route).metadata(metadata, APPLICATION_JSON) .data(request).retrieveMono(VoidRef) to requester.route(route).metadata(metadata, APPLICATION_JSON).data(request).send(). Any ideas why this could be happening? Thanks in advance!
    7 replies