SteeltoeOSS / Steeltoe

.NET Components for Externalized Configuration, Database Connectors, Service Discovery, Logging and Distributed Tracing, Application Management, Security, and more.
https://steeltoe.io
Apache License 2.0
1.01k stars 163 forks source link

It should be easy to use Steeltoe Components with YARP #773

Open TimHess opened 3 years ago

TimHess commented 3 years ago

Beyond being possible it should be easy to use at least Config Server and Service Discovery with YARP

An example of getting service discovery to work: https://github.com/Layla-P/TackyTacos/commit/210c8727d30f150480811bc64e075faa0dff6369

TimHess commented 3 years ago

Related to #761

bart-vmware commented 8 months ago

The plan is to replace DiscoveryClient.OnApplicationsChange which exposes all mutable internals and has no test coverage, with an event that provides access to IList<IServiceInstance>.

@macsux Thoughts?

macsux commented 8 months ago

YARP supports destinations resolver as a first-class pluggable API interface: https://microsoft.github.io/reverse-proxy/articles/destination-resolvers.html. Should be easy enough to map YARP to this

I'm not sure what you mean by configuration support. YARP bootstraps itself from some IConfiguration section, and update it's own routing state dynamically when values change in underlying IConfiguration object. So you can do it today. Since the only way to dynamically refresh config server today is via polling refresh timer, it would be good to update the logic at some point to only raise change token if any of the config values actually changed, as proxy reconfiguration is a kinda heavy operation which you don't wanna call unless something truly got updated.