Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

defaultRouter option in microservice API #218

Closed
8 tasks done
katzIdo opened this issue Nov 13, 2019 · 0 comments
Closed
8 tasks done

defaultRouter option in microservice API #218

katzIdo opened this issue Nov 13, 2019 · 0 comments

Comments

@katzIdo
Copy link
Collaborator

katzIdo commented Nov 13, 2019

General description

add option to configurate default router in microservice API.

creating a template for scalecube with default values is a bit complicated when trying to have a default router for the dependencyHook.

a template can for sclaecube-microservice such browser or node can override the API.

but when passing a callback reference (dependency hook) then scalecube will provide the default createProxy behavior of sclaecube-microservice (without the default router)

this lead to confusing behavior:
when using createProxy from ms container is will have the deafult router.
when using creteProxy from dependencyHook it will use sclaecube-microservice (without the default router)

API

Design proposition

A clear and concise description of the design proposition.

  • Is backward compatible

  • Changes existing API

Pull Request

[Link]

Old API

Code snippet

New API

Code snippet

interface MicroserviceOptions {
  defaultRouter ?: Router
}

Behavior

in case there is no default router and we don't provide a default router, then an exception will occur.

Test cases

Given a microservice container without setting defaultRouter
When calling createProxy without providing a router
Then exception will occur
Given a microservice container without setting defaultRouter
When calling createProxy  from dependencyHook without providing a router
Then exception will occur

Ready for implementation

  • API has been approved

  • Test cases have been prepared

  • Discussed with Technical lead

Definition of Done

  • Developer review

  • All tests are implemented

  • Documentation

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

No branches or pull requests

1 participant