Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unreliable service discovery #1

Closed
claustres opened this issue Sep 5, 2017 · 2 comments
Closed

Unreliable service discovery #1

claustres opened this issue Sep 5, 2017 · 2 comments
Labels

Comments

@claustres
Copy link
Member

Using pub/sub to expose local Feathers services to other nodes is not reliable because it depends on the order of initialization of the different apps. Indeed, the messages publishers publish are volatile in that if there are no subscribers listening, they are lost.

cote provides onAdded/onRemoved methods or events to be aware of other nodes, it might be overridden/used to have a more reliable solution. Another solution is to use req/res paradigm because a requester will just queue the request until a responder is available. But this requires every node to dispatch the complete service sets (including remote the ones) because req/res uses round-robin and a single responder will answer the request. Not completely sure it will be dependent of the initialization order yet.

However, the whole point of cote is to keep you from managing lists of services: that’s what autodiscovery is. cote services already discover each other automatically, you shouldn’t need to implement your own solution here. We can't probably target this because we'd like to be able to deploy our Feathers apps with services as usual or be able to deploy them as microservices using the cote plugin when we'd like to. Moreover Feathers already provides REST/Socket endpoints/clients so we'd like to keep it like this by actually make it become a sort of API gateway, without the need of using cote clients.

@claustres claustres added the bug label Sep 5, 2017
@claustres
Copy link
Member Author

Adding a third server instance with a remote service makes the bug appear in current tests.

@claustres
Copy link
Member Author

Fixed by re-emitting the event each time a new node appears

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant