mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 14:50:49 +08:00 
			
		
		
		
	Feature/store configuraton json idented (#328)
* messing around with benchmark.net.seems Ocelot adds about 2ms to a request..lets make this less? :) * #326 store json indented so it looks nice :P
This commit is contained in:
		@@ -163,7 +163,7 @@ requests. This would also mean that subsequent requests dont use the cookies fro
 | 
			
		||||
UseCookieContainer to true unless you have a really really good reason. Just look at your response headers and forward the cookies back with your next request! 
 | 
			
		||||
 | 
			
		||||
SSL Errors
 | 
			
		||||
----------
 | 
			
		||||
^^^^^^^^^^
 | 
			
		||||
 | 
			
		||||
Id you want to ignore SSL warnings / errors set the following in your ReRoute config.
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -69,18 +69,20 @@ In order to get this working add the following to ocelot.json..
 | 
			
		||||
        "Type": "Eureka"
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
And following the guide `Here <https://steeltoe.io/docs/steeltoe-discovery/>`_ you may also need to add some stuff to appsettings.json. For example the json below
 | 
			
		||||
tells the steeltoe / pivotal services where to look for the service discovery server and if the service should register with it.
 | 
			
		||||
And following the guide `Here <https://steeltoe.io/docs/steeltoe-discovery/>`_ you may also need to add some stuff to appsettings.json. For example the json below tells the steeltoe / pivotal services where to look for the service discovery server and if the service should register with it.
 | 
			
		||||
 | 
			
		||||
.. code-block:: json
 | 
			
		||||
 | 
			
		||||
    "eureka": {
 | 
			
		||||
        "client": {
 | 
			
		||||
        "serviceUrl": "http://localhost:8761/eureka/",
 | 
			
		||||
        "shouldRegisterWithEureka": true
 | 
			
		||||
        "shouldRegisterWithEureka": false,
 | 
			
		||||
        "shouldFetchRegistry": true
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
I am told that if shouldRegisterWithEureka is false then shouldFetchRegistry will defaut to true so you don't need it explicitly but left it in there.
 | 
			
		||||
 | 
			
		||||
Ocelot will now register all the necessary services when it starts up and if you have the json above will register itself with 
 | 
			
		||||
Eureka. One of the services polls Eureka every 30 seconds (default) and gets the latest service state and persists this in memory.
 | 
			
		||||
When Ocelot asks for a given service it is retrieved from memory so performance is not a big problem. Please note that this code
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user