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

Add event for when Eureka registry is updated #765

Merged
merged 5 commits into from
Feb 23, 2022
Merged

Conversation

macsux
Copy link
Contributor

@macsux macsux commented Sep 7, 2021

Adds support for #761

@TimHess
Copy link
Member

TimHess commented Sep 7, 2021

/azp run Steeltoe.All

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@TimHess
Copy link
Member

TimHess commented Sep 7, 2021

Given the location of the change it's not immediately clear to me how somebody would take advantage of this change, can you provide an example of what you expect that'd look like?

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecov
Copy link

codecov bot commented Sep 7, 2021

Codecov Report

Merging #765 (3d65069) into main (947dfb0) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #765      +/-   ##
==========================================
+ Coverage   74.22%   74.24%   +0.02%     
==========================================
  Files        1306     1306              
  Lines       45540    45540              
  Branches     8953     8953              
==========================================
+ Hits        33802    33812      +10     
+ Misses       9235     9225      -10     
  Partials     2503     2503              
Impacted Files Coverage Δ
src/Discovery/src/Eureka/DiscoveryClient.cs 56.25% <ø> (ø)
...rc/RabbitMQ/Connection/CachingConnectionFactory.cs 58.46% <0.00%> (-0.09%) ⬇️
...gement/src/EndpointBase/ThreadDump/ThreadDumper.cs 68.87% <0.00%> (+0.82%) ⬆️
...n/src/Common/Converter/GenericConversionService.cs 75.54% <0.00%> (+1.08%) ⬆️
.../StreamBase/Binder/AbstractMessageChannelBinder.cs 68.45% <0.00%> (+1.43%) ⬆️
....MetricsStreamCore/RabbitMetricsStreamPublisher.cs 15.38% <0.00%> (+2.56%) ⬆️
...StreamBase/Binding/AbstractBindableProxyFactory.cs 72.00% <0.00%> (+4.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 947dfb0...3d65069. Read the comment docs.

@sonarcloud
Copy link

sonarcloud bot commented Sep 7, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@macsux
Copy link
Contributor Author

macsux commented Sep 7, 2021

Something like this

public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IDiscoveryClient client)
        {
            var eureka = (DiscoveryClient) client;
            eureka.OnApplicationsChange += (sender, applications) =>
            {
                Console.WriteLine("====");
                foreach (var application in applications.GetRegisteredApplications())
                {
                    Console.WriteLine($"App: {application.Name}");
                    foreach (var instance in application.Instances)
                    {
                        Console.WriteLine($"  {instance.Actiontype} {instance.HostName}:{instance.Port}");
                    }
                }
            };

@TimHess TimHess added this to the 3.2.0 milestone Sep 8, 2021
@TimHess TimHess added Component/Discovery Issues related to Steeltoe Service Discovery ReleaseLine/3.x Identified as a feature/fix for the 3.x release line labels Sep 8, 2021
@jkonicki jkonicki added the Status/needs-more-info Additional information required from filer of issue label Sep 20, 2021
@TimHess
Copy link
Member

TimHess commented Sep 23, 2021

This implementation should be OK for now, but we'll probably want to revisit with this issue to align with Spring and things like ApplicationEvent

Do you have time to add a unit test for this @macsux?

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sonarcloud
Copy link

sonarcloud bot commented Feb 23, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@TimHess TimHess merged commit 76827f8 into SteeltoeOSS:main Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component/Discovery Issues related to Steeltoe Service Discovery ReleaseLine/3.x Identified as a feature/fix for the 3.x release line Status/needs-more-info Additional information required from filer of issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants