GithubHelp home page GithubHelp logo

Comments (8)

x-cubed avatar x-cubed commented on July 18, 2024

At minimum, a packet capture of the traffic on port 1113 would give us some insight into what is going on.

Is the subscription (rather than the connection) onDropped handler being invoked with a reason why the subscription was cancelled?

from event-store-client.

PaulGrimshaw avatar PaulGrimshaw commented on July 18, 2024

I haven't managed to do a packet capture yet. But I have found an issue on the server where the DNS was dropping periodically, so maybe this was the issue? I connect by direct IP however so I wouldn't have expected that.

I was logging in all the callbacks (onDropped / onErrror) in both the connection and subscription, but nothing was logged. I have switched to a poll based subscription for now, will revisit when i have more time.

from event-store-client.

x-cubed avatar x-cubed commented on July 18, 2024

It might be that the Event Store needs to be pinged regularly for it to consider the connection to be alive alive, and that's not something that the client does automatically, but those methods are exposed on the connection for your application to use.

from event-store-client.

PaulGrimshaw avatar PaulGrimshaw commented on July 18, 2024

Ok have updated our code to fire a ping every 10 seconds. Will keep an eye on it and see if this prevents the dropout.

from event-store-client.

PaulGrimshaw avatar PaulGrimshaw commented on July 18, 2024

Just to confirm, firing a regular ping to keep the connection alive appears to have resolved this issue. Would this not be something you'd have the client do on connect?

Anyhow thanks for the solution.

from event-store-client.

x-cubed avatar x-cubed commented on July 18, 2024

It would need to be done regularly so that the server knows that the client is still there. Ideally, that would be done on a timer in your application.

from event-store-client.

PaulGrimshaw avatar PaulGrimshaw commented on July 18, 2024

Yes. I have a wrapper class around the API with a connect and disconnect method. The connect method starts a timer pinging every 10 seconds, the disconnect clears the timer. Just thought this could maybe be behaviour the library could take over, as it's not immediately obvious for others that you'd need to do this for a long subscription.

from event-store-client.

x-cubed avatar x-cubed commented on July 18, 2024

Yeah, if there's a way we can get the library to do it that would be good.
It's been a while since I've looked at timers and threading in Node.js, so I'm not too familiar with how we can do it without potentially affecting the application itself.

from event-store-client.

Related Issues (20)

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.