-
Notifications
You must be signed in to change notification settings - Fork 163
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
Discovery public API review and refactorings #1280
Conversation
/azp run Steeltoe.All |
No pipelines are associated with this pull request. |
Azure Pipelines successfully started running 1 pipeline(s). |
…imilar to CapturingLoggerProvider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks like a huge improvement, quite a bit easier to read and understand
src/Configuration/src/CloudFoundry.ServiceBinding/ConfigurationBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Tim Hess <tim.hess@broadcom.com>
Co-authored-by: Tim Hess <tim.hess@broadcom.com>
Co-authored-by: Tim Hess <tim.hess@broadcom.com>
Co-authored-by: Tim Hess <tim.hess@broadcom.com>
Co-authored-by: Tim Hess <tim.hess@broadcom.com>
/azp run Steeltoe.All |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Azure Pipelines successfully started running 1 pipeline(s). |
Azure Pipelines successfully started running 1 pipeline(s). |
Quality Gate passedIssues Measures |
Thank you! This is a huge win I think. |
Description
This PR is the result of the public API review for Steeltoe Service Discovery, along with various bug fixes, improvements, and refactorings. Changes are listed below.
General
[InternalsVisibleTo]
entries, optimize project dependenciesIServiceInfo
and related assembly scanning attributesHostBuilder
extensions, in favor of extensions onIServiceCollection
NotSupportedException
instead ofNotImplementedException
for things that were deliberately not implementedFormatException
instead ofInvalidOperationException
when the conversion of primitive type failsLoad balancing
NoOpDiscoveryClient
(and related warnings) has been removed, as load balancers can query multiple discovery clients nowSteeltoe.Discovery.HttpClients
projectIHttpClientBuilder.AddServiceDiscovery<TLoadBalancer>()
for a named client, or useDiscoveryHttpClientHandler
for non-factory scenariosService Discovery
Steeltoe.Discovery.Abstractions
, move configuration-based discovery into new projectSteeltoe.Discovery.Configuration
IServiceInstanceProvider
intoIDiscoveryClient
, moved toSteeltoe.Common.Abstractions
AddServiceDiscovery
andAddDiscoveryClient
(registration) extension methods (which used assembly scanning), in favor of client-specific extension methods with explicit dependenciesIDiscoveryClientExtension
, in favor of using the built-in D/I containerHttpClient
s within the app), ie:services.ConfigureHttpClientDefaults(builder => builder.AddServiceDiscovery());
Consul
PeriodicTimer
for background heartbeats (async and cancellable, no overlaps)IValidateOptions
, so anOptionsValidationException
is thrown on an invalid configurationconsul:discovery:cacheTtl
, which used to set globalDistributedCacheEntryOptions
for the entire app (dangerous and non-intuitive), you can still register this yourself, which will be picked upconsul:discovery:UseNetUtils
toconsul:discovery:UseNetworkInterfaces
Steeltoe.Discovery.Consul.Discovery
toSteeltoe.Discovery.Consul
Eureka
ScopedEurekaHealthCheckHandler
toEurekaHealthCheckHandler
DateTime
for timestamps, instead oflong
(which could be .NET ticks or Java ticks).IValidateOptions
, so anOptionsValidationException
is thrown on an invalid configurationTimeSpan
for timeouts and intervals, instead of seconds/milliseconds${eureka.hostname}
HttpClient
fromHttpClientFactory
, so the handler pipeline can be tweaked as desired (ie custom headers)eureka:client:EurekaServer:RetryCount
indicates the number of retries, instead of attemptsJsonSerializerOptions
instead of recreating it on every requesteureka:client:shouldOnDemandUpdateStatusChange
, updates are always sent immediately when instance changes (from configuration or user code)eureka:instance:defaultAddressResolutionOrder
because it was never used nor documentedeureka:client:cacheTtl
, which used to set globalDistributedCacheEntryOptions
for the entire app (dangerous and non-intuitive), you can still register this yourself, which will be picked upeureka:instance:UseNetUtils
toeureka:instance:UseNetworkInterfaces
eureka:instance:vipAddress
andeureka:instance:secureVipAddress
OverriddenStatus
into account when evaluating instance statusFixes #901, fixes #1107, fixes #829, fixes #786, fixes #493, fixes #480, fixes #479, fixes #121, fixes #11.
Quality checklist
If your change affects other repositories, such as Documentation, Samples and/or MainSite, add linked PRs here.