mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 12:18:16 +08:00
Feature/removed consul and its deps to other package (#539)
* #529 removed consul deps and introduced delegate to find service discovery provider * +semver: breaking moved consul configuration to package..introduced mechanism for packages to configure Ocelot pipeline
This commit is contained in:
@ -121,13 +121,18 @@ At the moment there is no validation at this stage it only happens when Ocelot v
|
||||
Store configuration in consul
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If you add the following when you register your services Ocelot will attempt to store and retrieve its configuration in consul KV store.
|
||||
The first thing you need to do is install the NuGet package that provides Consul support in Ocelot.
|
||||
|
||||
``Install-Package Ocelot.Provider.Consul``
|
||||
|
||||
Then you add the following when you register your services Ocelot will attempt to store and retrieve its configuration in consul KV store.
|
||||
|
||||
.. code-block:: csharp
|
||||
|
||||
services
|
||||
.AddOcelot()
|
||||
.AddStoreOcelotConfigurationInConsul();
|
||||
.AddConsul()
|
||||
.AddConfigStoredInConsul();
|
||||
|
||||
You also need to add the following to your ocelot.json. This is how Ocelot
|
||||
finds your Consul agent and interacts to load and store the configuration from Consul.
|
||||
|
@ -11,6 +11,17 @@ you specify a ServiceName for at ReRoute level.
|
||||
Consul
|
||||
^^^^^^
|
||||
|
||||
The first thing you need to do is install the NuGet package that provides Consul support in Ocelot.
|
||||
|
||||
``Install-Package Ocelot.Provider.Consul``
|
||||
|
||||
Then add the following to your ConfigureServices method.
|
||||
|
||||
.. code-block:: csharp
|
||||
|
||||
s.AddOcelot()
|
||||
.AddConsul();
|
||||
|
||||
The following is required in the GlobalConfiguration. The Provider is required and if you do not specify a host and port the Consul default
|
||||
will be used.
|
||||
|
||||
|
Reference in New Issue
Block a user