-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add a possibility to change service name dynamically because of Consul tags #1188
Comments
Hello, Mantas! I see the problem...
Do you mean, an extra slash char starts Consul tag? Finally, I see that complete Consul service name template is Could you share a link to Consul docs regarding tags please? |
+ Accepted ... because of ready PR #1198 |
Not really.. we can have multiple services behind gateway, for example: So as you can see url starts with the same word.. but further on we can have more microservices running. |
OK
But I think it is not a stopper for PR logic, because you have not introduced any Consul hardcoded features. Only feature decoupling by interface. I thought Consul has some requirements and you wish to introduce them in the PR. No questions anymore! 😸 |
Not really. Path is just a key to configuration item. That item has all necessary information about downstream service. To be honest - now I would do this PR a bit differently. Finder should take HttpRequest as parameter and then you can have various logics in routing where service instance can be identified by:
In microservices world where services are created and registered kind of dynamically such kind of flexibility is necessary. |
@mantasaudickas commented on July 28:
Any changes and improvements are welcome in current PR!
Some of these properties we have in current public Response<DownstreamRouteHolder> Get(
string upstreamUrlPath,
string upstreamQueryString,
string upstreamHttpMethod,
IInternalConfiguration configuration,
string upstreamHost)
{ } So, any additional objects vs data will require to change the Will you push some commit soon? |
Sorry, no chance.. But you can do it on your own.. just IDownstreamServiceFinder should have this signature:
|
@ggnaegi Your opinion, Gui? |
Dear @mantasaudickas !
Since the new behavior is necessary for service discovery, you will need to consider a new design approach and develop a Custom Provider tailored to your requirements.
There's no need to replace the entire @ggnaegi FYI |
Hello,
At the moment service name is chosen based on first segment in the path.
I would like to be able to map one (or multiple) path segments to service name in Consul.
Few examples:
authorization
=> would mapped toauthorization.service.web
authorization/api
=> would be mapped toauthorization.service.api
Reason for this, that my routes are defined in Consul tags and I would like to use them as a key when selecting service name in Consul.
At the moment to achieve this I have to replace whole
DownstreamRouteCreator
class, while I would be keen to keep custom part as small as possible.Would you mind if I make a PR for this?
So something like:
and use this such provider in
CustomDownstreamRouteCreator
class.with best regards
The text was updated successfully, but these errors were encountered: