de-register services from service discovery using steeltoe in .net framework 4.8

81 Views Asked by At

I m trying to implement service discovery using Steeltoe in .net framework 4.8. I was able to register the service in Eureka but as the service stops, I am not able to remove it from the registry. Is there a way to do that?

1

There are 1 best solutions below

0
Tim On

Steeltoe provides a ShutdownAsync method on IDiscoveryClient that will handle the de-registration. Here's an example of it being called in Application_End().

It is worth noting that Visual Studio may not always do a graceful shutdown of your app, so sometimes shutdown events do not fire during local testing.

PS: Steeltoe is a bit of a niche library, so adding the steeltoe tag on any future questions should help a lot with getting faster answers!