drawaes / condenserdotnet Goto Github PK
View Code? Open in Web Editor NEWAPI Condenser / Reverse Proxy using Kestrel and Consul, Including light weight consul lib
License: MIT License
API Condenser / Reverse Proxy using Kestrel and Consul, Including light weight consul lib
License: MIT License
HTTPS after the filter breaks on 4.61/2 but works on netcoreapp1.1
This naming is confusing as it is not really a service but the "Core" functions of the two (Server and Client) libraries.
I propose we rename to CondenserDotNet.Core
@deanshackley what do you think?
When there is no consul service available the call hangs forever
I keep my URL/port number in hosting.json like this:
{
"urls": "http://*:8075"
}
i would like to build my host like this:
var config = new ConfigurationBuilder()
.AddJsonFile("hosting.json", optional: false)
.Build();
var builder = WebHost.CreateDefaultBuilder(args)
.CaptureStartupErrors(true)
.UseSetting(WebHostDefaults.DetailedErrorsKey, "true")
.UseKestrel()
.UseConfiguration(config) //Will read "urls" key from hosting.json
.UseStartup<Startup>();
Then in Startup.cs, in Configure(), I would add the middleware like this:
app.UseWindowsAuthentication();
I then get this error: You need the connection filter installed to use windows authentication
The unit test shows that you need to add WindowsAuthentication middleware to ListenOptions in UseKestrel but that method also requires a URL/port number.
Any way to make it work while storing URL/port number in config file?
now I can only use properties
serviceManager.ProtocolSchemeTag = " protocolScheme-tag";
serviceManager.SupportedUrls.Add("urlprefix-tag");
and I want to use
serviceManager.Tags.Add("myTag");
Actually the only way to provide configuration to Condenser is as a Json Object like
{
"Key": "Value"
}
if i try to create a config object which is an array:
[
{
"key":"value1"
},
{
"key":"value2"
}
]
I get an exception like: Current JsonReader item is not an object: StartArray. Path '', line 1, position 2.
I have changed behavior of the JsonKeyValueParser in the Function Parse:
diff --git a/src/CondenserDotNet.Client/Configuration/JsonKeyValueParser.cs b/src/CondenserDotNet.Client/Configuration/JsonKeyValueParser.cs
index 4b4935d..d528995 100644
--- a/src/CondenserDotNet.Client/Configuration/JsonKeyValueParser.cs
+++ b/src/CondenserDotNet.Client/Configuration/JsonKeyValueParser.cs
@@ -30,10 +30,10 @@ namespace CondenserDotNet.Client.Configuration
{
DateParseHandling = DateParseHandling.None
};
+
+ var jsonConfig = JToken.Load(_reader);
- var jsonConfig = JObject.Load(_reader);
-
- VisitJObject(jsonConfig);
+ VisitToken(jsonConfig);
foreach (var kv in _data)
yield return new KeyValue
Now everything is OK
(Sorry i am lazy to make a PR :) )
This will allow for metrics later.
I propose that the counters should be held per thread in thread local storage and then we can combine when we want to count/aggregate them.
So that clients don't have to run a TCP port or an HTTP server but instead can push health checks to consul
This will require a clean up of the ServiceManager's constructor as currently it is getting a little to "busy".
Currently there are a couple of names to do with Routing that makes it confusing.
Such as Redis for global locks, etc
Hi
I need to build a Configuration object from Consul with a specific token. But looks like IConsulAclProvider is only available for the ServiceRegistry, not for the ConfigurationRegistry.
Can we update it ?
Thks
Julien
We need some scenarios for routing performance tests. We can then add these and make sure we are running them regularly so as to avoid performance regressions
I know this project hasn't been worked on in a while and I assume that's because it meets your goals / needs.
I wondered if you had any plans target .net 6 in future?
I also had a general observation as a newbie trying to figure out what this project does - the docs were helpful, but I didn't really understand from them the following:-
Many thanks!
I think, it happed because AddStaticKeyPathAsync()
method uses ConsulConfigSource.FormValidKey()
which adds /
character to the end.
In consul documentation path looks like /kv/:key
.
https://demo.consul.io/v1/kv/hi - works
https://demo.consul.io/v1/kv/hi/ - not:(
We now support more than 1 type of health check per server registration, however when there is more than one we need to support writing back the numbering for the correct names for future references
Should be able to load key/value pairs from a list of paths, including overloading and providing it in the new .net Core configuration object
When finding available services we should fail over to other datacenters if no healthy service instance is available in this DC
Hello,
First: this is a Great work! Thanks for this.
I am actually playing around with consul and this library. And I often start the app in a container.
And also shutdown it. And start it again, multiple times with multiple instances.
This leaves stale service registrations on consul. And I have to deregister them manually.
It would be nice to have a method to deregister the service via code.
After ServiceManager.RegisteredService exist.
Thanks.
When you add a health check it generates the URI at that time. If you then change the port the server is on but before registration the healthcheck will not be updated.
Using consul we can get a "Distance" to a service which we should support
We should keep retrying consul until it comes up. We should also expose the status of the registry with it's connection status and clean up error messages.
This will allow services to be lowered in priority
If using the leader function we find that there is a problem with the failover.
If have a single instance of service which has aquired the leadership lock, but then kill consul on that server. When subsequently we restart consul the service should reaquire the leadership lock (assuming there was no other instance of the service running which had aquired the lock). However it does not re-aquire the leadership lock.
Similary if have a second instance of the service running which aquires the lock when consul is killed on the server where the instance had originally aquired the lock - then thre is no log message to say the original instance lost the lock.
I believe the issue that needs to be fixe is that any exception in the KeepLeadership loop in LeaderWatcher is swallower and the loop stops. It may need to have try catch similar tot he the watcherLoop in ServiceWatcher.
Thanks Derek
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.