-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from TomPallister/develop
merge newest code
- Loading branch information
Showing
138 changed files
with
3,867 additions
and
1,400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
./build.ps1 -target BuildAndReleaseUnstable | ||
./build.ps1 -target BuildAndReleaseUnstable | ||
exit $LASTEXITCODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
./build.ps1 -target RunTests | ||
./build.ps1 -target RunTests | ||
exit $LASTEXITCODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Raft (EXPERIMENTAL DO NOT USE IN PRODUCTION) | ||
============================================ | ||
|
||
Ocelot has recenely integrated `Rafty <https://github.com/TomPallister/Rafty>`_ which is an implementation of Raft that I have also been working on over the last year. This project is very experimental so please do not use this feature of Ocelot in production until I think it's OK. | ||
|
||
Raft is a distributed concensus algorythm that allows a cluster of servers (Ocelots) to maintain local state without having a centralised database for storing state (e.g. SQL Server). | ||
|
||
In order to enable Rafty in Ocelot you must make the following changes to your Startup.cs. | ||
|
||
.. code-block:: csharp | ||
public virtual void ConfigureServices(IServiceCollection services) | ||
{ | ||
services | ||
.AddOcelot(Configuration) | ||
.AddAdministration("/administration", "secret") | ||
.AddRafty(); | ||
} | ||
In addition to this you must add a file called peers.json to your main project and it will look as follows | ||
|
||
.. code-block:: json | ||
{ | ||
"Peers": [{ | ||
"HostAndPort": "http://localhost:5000" | ||
}, | ||
{ | ||
"HostAndPort": "http://localhost:5002" | ||
}, | ||
{ | ||
"HostAndPort": "http://localhost:5003" | ||
}, | ||
{ | ||
"HostAndPort": "http://localhost:5004" | ||
}, | ||
{ | ||
"HostAndPort": "http://localhost:5001" | ||
} | ||
] | ||
} | ||
Each instance of Ocelot must have it's address in the array so that they can communicate using Rafty. | ||
|
||
Once you have made these configuration changes you must deploy and start each instance of Ocelot using the addresses in the peers.json file. The servers should then start communicating with each other! You can test if everything is working by posting a configuration update and checking it has replicated to all servers by getting there configuration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,38 @@ | ||
Big Picture | ||
=========== | ||
|
||
Coming soon... | ||
Ocleot is aimed at people using .NET running | ||
a micro services / service orientated architecture | ||
that need a unified point of entry into their system. | ||
|
||
In particular I want easy integration with | ||
IdentityServer reference and bearer tokens. | ||
|
||
Ocelot is a bunch of middlewares in a specific order. | ||
|
||
Ocelot manipulates the HttpRequest object into a state specified by its configuration until | ||
it reaches a request builder middleware where it creates a HttpRequestMessage object which is | ||
used to make a request to a downstream service. The middleware that makes the request is | ||
the last thing in the Ocelot pipeline. It does not call the next middleware. | ||
The response from the downstream service is stored in a per request scoped repository | ||
and retrived as the requests goes back up the Ocelot pipeline. There is a piece of middleware | ||
that maps the HttpResponseMessage onto the HttpResponse object and that is returned to the client. | ||
That is basically it with a bunch of other features. | ||
|
||
The following are configuration that you use when deploying Ocelot. | ||
|
||
Basic Implementation | ||
^^^^^^^^^^^^^^^^^^^^ | ||
.. image:: ../images/OcelotBasic.jpg | ||
|
||
With IdentityServer | ||
^^^^^^^^^^^^^^^^^^^ | ||
.. image:: ../images/OcelotIndentityServer.jpg | ||
|
||
Multiple Instances | ||
^^^^^^^^^^^^^^^^^^ | ||
.. image:: ../images/OcelotMultipleInstances.jpg | ||
|
||
With Consul | ||
^^^^^^^^^^^ | ||
.. image:: ../images/OcelotMultipleInstancesConsul.jpg |
Oops, something went wrong.