Code Monkey home page Code Monkey logo

Comments (8)

cjus avatar cjus commented on May 18, 2024

@jkyberneees on startup, your hapi-service-test should have sent a message to hydra-router with its updated routes.

from hydra-router.

jkyberneees avatar jkyberneees commented on May 18, 2024

Hi @cjus, it does it. However the issue appears when multiple services have registered the same route.
IMO the router should decide for the service that match the route but also is online.

from hydra-router.

cjus avatar cjus commented on May 18, 2024

@jkyberneees I looked into this. I don't see a way to address it. I think it's up to the service builder to ensure that routes are not reused by other services. Meaning two different services should not both register v1/{serviceName}/endpoint. I also think that service registries have to expire at some point. Perhaps a router that ends up with a 503 might flush the service registry or perhaps a Lua script in Redis.

from hydra-router.

jkyberneees avatar jkyberneees commented on May 18, 2024

Hi @cjus, I can suggest you to check for service presence before accept the route match.
You can see an example here: https://github.com/jkyberneees/hydra-plugin-http/blob/master/libs/proxy.js#L35
I agree on the flush of the routes if 503 is detected, that would keep the router more performant and consistent.

Regards.

from hydra-router.

arn-the-long-beard avatar arn-the-long-beard commented on May 18, 2024

Hello
This discussion is old, but I have the same issue with hydra-router.

I used the different command for clean and refresh:
hydra-cli refresh
hydra-cli refresh node list

but hydra-cli routes show me the old dead services and then hydra-router cannot work correctly.

Is it something I am missing for cleaning/refresh ?

from hydra-router.

cjus avatar cjus commented on May 18, 2024

@arn-the-long-beard which version of hydra-cli are you using? How comfortable are you with Redis? Is this happening locally or on a production server?

from hydra-router.

arn-the-long-beard avatar arn-the-long-beard commented on May 18, 2024

Hello @cjus :)

I am using [email protected]

For now this is happening locally. I am a very newbie to Hydra and Redis also. I am building micro services for a distributed system for the startup I am working.

from hydra-router.

emirhg avatar emirhg commented on May 18, 2024

Same problem here. I'm using [email protected]

hydra-cli refresh and hydra-cli refresh node listkeeps old routes, is not cleaning properly

from hydra-router.

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.