Coder Social home page Coder Social logo

Comments (4)

airduster avatar airduster commented on June 11, 2024

never mind figured this out was passing responder incorrectly into rsocket-js constructor :/

from spring-flights.

EBoshart avatar EBoshart commented on June 11, 2024

Hi airduster, I'm running into the exact same issue you described
I am able to receive data through regular request / response, however I am not able to asynchronously send server data to all connected clients.

I'm trying to get your testFirstAndForget method to work, but whatever the server sends back is never received by the client.

My client configuration looks something like this:

client = new RSocketClient({ serializers: { data: JsonSerializer, metadata: JsonMetadataSerializer, }, setup: { // ms btw sending keepalive to server keepAlive: 10000, // ms timeout if no keepalive response lifetime: 20000, dataMimeType: 'application/json', metadataMimeType: "application/vnd.spring.rsocket.metadata+json", }, transport: new RSocketWebSocketClient({url: "ws://localhost:8080/rsocket"}), responder: new messageHandler() });

export class messageHandler { fireAndForget(payload) : void { console.log("received from server :" + payload.data) }

Any ideas would be greatly appreciated

from spring-flights.

airduster avatar airduster commented on June 11, 2024

Hi airduster, I'm running into the exact same issue you described
I am able to receive data through regular request / response, however I am not able to asynchronously send server data to all connected clients.

I'm trying to get your testFirstAndForget method to work, but whatever the server sends back is never received by the client.

My client configuration looks something like this:

client = new RSocketClient({ serializers: { data: JsonSerializer, metadata: JsonMetadataSerializer, }, setup: { // ms btw sending keepalive to server keepAlive: 10000, // ms timeout if no keepalive response lifetime: 20000, dataMimeType: 'application/json', metadataMimeType: "application/vnd.spring.rsocket.metadata+json", }, transport: new RSocketWebSocketClient({url: "ws://localhost:8080/rsocket"}), responder: new messageHandler() });

export class messageHandler { fireAndForget(payload) : void { console.log("received from server :" + payload.data) }

Any ideas would be greatly appreciated

Just seeing this. Your code looks correct. My guess is the client is receiving the message but it is being swallowed up somewhere in the rsocket-js code. Place a breakpoint deep inside the rsocket-js code as soon as a msg to determine where it is being swallowed up. Might have something to do with with RSocketStrategiesCustomizer. Did you define that bean as I described above?

from spring-flights.

EBoshart avatar EBoshart commented on June 11, 2024

Hi Airduster, thanks for your reply
A couple days after my original post I realised my error.

Whenever I reloaded my client because of local changes the server would still keep the old socket, then when iterating over the connected clients it would error because it could no longer find that socket, so I added an onError -> remove connection and that seems to solve it.

from spring-flights.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.