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

Is Custom Service Discovery or Dynamic Route Registration Supported? #1225

Closed
schwede opened this issue May 7, 2020 · 4 comments · Fixed by #1656
Closed

Is Custom Service Discovery or Dynamic Route Registration Supported? #1225

schwede opened this issue May 7, 2020 · 4 comments · Fixed by #1656
Assignees
Labels
feature A new feature merged Issue has been merged to dev and is waiting for the next release

Comments

@schwede
Copy link

schwede commented May 7, 2020

If you are not using Consul or Eureka and you have routes that are not static but still need to registered dynamically, is this possible with the current release?

@raman-m
Copy link
Member

raman-m commented May 24, 2023

@schwede Hi Swede!
Could you review the solution in #1656 please?
Is this something you're looking for?

I believe having a custom service discovery provider will allow you to have the most dynamic solution on the full control of service registry.

@raman-m raman-m added the waiting Waiting for answer to question or feedback from issue raiser label May 24, 2023
@raman-m raman-m added feature A new feature medium effort Likely a few days of development effort accepted Bug or feature would be accepted as a PR or is being worked on in progress Someone is working on the issue. Could be someone on the team or off. and removed question Initially seen a question could become a new feature or bug or closed ;) waiting Waiting for answer to question or feedback from issue raiser labels Jun 9, 2023
@raman-m
Copy link
Member

raman-m commented Jun 9, 2023

@leonluc-dev You are assigned! 😸

@raman-m
Copy link
Member

raman-m commented Jun 9, 2023

@schwede Hi Swede!
I don't know why don't you reply, but I'm just answering on your 2nd question:

Dynamic Route Registration Supported?

Yes and No! We need to understand who is performer of this dynamic routes registration.

If this is well-known service discovery provider with reflection to Ocelot Routes then it looks like the same functionality as it was requested in issue #340. This is Dynamic Routing paragraph for Service Discovery feature.

If you meant that Ocelot is responsible for service registrations then it looks like the role of service provider is delegated to Ocelot core, and we have the case of completely custom solution for custom service discovery provider. This case is covered by current #1656 PR. It is not production ready solution, but it shows the direction of implementation of custom service discovery provider being hosted inside the Ocelot core. The business logic can be implemented inside the gateway core or as a developer you could integrate to those service discovery providers which are not mentioned in current release. And this solution will be a custom service discovery solution.

I believe the #1656 PR will close your feature request.
And you are welcome to enhance new Service Discovery sample in future.

@raman-m raman-m pinned this issue Jun 9, 2023
@raman-m raman-m removed the in progress Someone is working on the issue. Could be someone on the team or off. label Sep 8, 2023
@raman-m
Copy link
Member

raman-m commented Sep 8, 2023

raman-m added a commit that referenced this issue Sep 28, 2023
…stom Providers (#1656)

* Update servicediscovery documentation to include custom provider

* Update servicediscovery.rst

Custom Providers paragraph

* Update servicediscovery.rst

Fix lower/upper case in paragraph name

* Added custom service provider sample

* Minor clarification to custom service discovery provider docs

* Move usings to the top. Use file-scoped namespace declaration

* Moved custom service discovery sample
Added sample to Ocelot.sln

* Added custom service provider sample

* Move usings to the top. Use file-scoped namespace declaration

* Moved custom service discovery sample
Added sample to Ocelot.sln

* Add 2 options/ways of solution development via ConfigureServices

* Upgrade DownstreamService to ASP.NET 7

* Upgrade ApiGateway to ASP.NET 7

* Update README.md

* Removed redundant spring section in config
Move urls config from Program.cs to appsettings.json

* Workaround for the Categories route

* Rename controller: class name should be the same as file name

* Upgrade to Web API app: multiple startup profiles, add Docker profile. Basic microservices template

* Correct registration of IServiceDiscoveryProviderFactory interface

* Update README.md: Fix upstream path because of case sensitivity

* Update servicediscovery.rst: Update Custom Providers section. Add sample solution.

* Update servicediscovery.rst: Update actual code from the sample

* Remove obsolete code

* CS8632 The annotation for nullable reference types should only be used in code within a '#nullable' annotations context

* Revert to previous state

* Revert back to the version from ThreeMammals:develop

* Update servicediscovery.rst: English checking

---------

Co-authored-by: raman-m <dotnet044@gmail.com>
@raman-m raman-m added merged Issue has been merged to dev and is waiting for the next release and removed medium effort Likely a few days of development effort accepted Bug or feature would be accepted as a PR or is being worked on labels Sep 28, 2023
@raman-m raman-m unpinned this issue Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature merged Issue has been merged to dev and is waiting for the next release
Projects
None yet
2 participants