cecilphillip / aspnet-servicediscovery-patterns Goto Github PK
View Code? Open in Web Editor NEWSamples of simple service discovery patterns with ASP .NET Core
License: MIT License
Samples of simple service discovery patterns with ASP .NET Core
License: MIT License
Looking at the Self Registration example there is no Extensions class even though read me mentions it. Also there is no one calling ConsulHostedService constructor or StartAsync (perhaps this is inside missing Extensions.cs class)
Hi there,
I've got a question on how should I proceed if I'd like to register multiple instances of service X ?
In this sample, a previous instance of the service is de-registered 1st. What's the recommended approach to registering multiple service instances?
var registration = new AgentServiceRegistration()
{
ID = consulConfig.Value.ServiceID,
Name = consulConfig.Value.ServiceName,
Address = $"{uri.Scheme}://{uri.Host}",
Port = uri.Port,
Tags = new[] { "Students", "Courses", "School" }
};
var registrationTask = consulClient.Agent.ServiceDeregister(registration.ID)
.Then(() => consulClient.Agent.ServiceRegister(registration));
registrationTask.Wait();
Your load balancing example doesnt actually do any load balancing at all, unless I am mistaken.
From what I can see you have a publisher (client) that pushes out on Rabbit channel, and an endpoint (SchoolService which is really just Queue listener/handler) that simply responds to the incoming Rabbit channel message and sends response back to publisher.
This is it, there is no load balancing out to any other services (unless you call your DataStore a service which it really isnt, as its just a repo really) ok you say you are using Rabbit broker as load balancer, but feels a little confused to me
Dont get me wrong this is excellent repo, but this is not load balancing at all, as there is just a pub/sub and competing consumer, its just a rabbit demo really.
I guess what I was expecting to find, was more in line with say how Kubernetes does things, that you have your API endpoints, and you have a rabbit consumer over that, that knows which API services are available and would round robin between them. There would have to be some form of registration associated with that though where each endpoint would register itself with the actual load balancer (this could be app for me I guess) via a rabbit message
Ok I understand this arguably achieved the same thing, but its not really load balancing, its competing consumers really
Thoughts?
Hi Cecil,
I would like to borrow some of your code to create a nuget package to share with others. Would you mind adding a license so that I may do that? I don't want to assume that is OK with you.
Thanks.
Brad
https://choosealicense.com/no-license/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.