mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 22:42:51 +08:00

* #318 http client obeys Qos timeout or defaults to 90 seconds, which is think is default for http client anyway but zero docs.... * #318 updated docs to specify default timeout and make it clear how to set it on a ReRoute basis * #318 missed this * #318 missed this
334 lines
8.8 KiB
JSON
334 lines
8.8 KiB
JSON
{
|
|
"ReRoutes": [
|
|
{
|
|
"DownstreamPathTemplate": "/profile",
|
|
"DownstreamScheme": "http",
|
|
"UpstreamPathTemplate": "/profile",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "localhost",
|
|
"Port": 3000
|
|
}
|
|
],
|
|
"QoSOptions": {
|
|
"TimeoutValue": 360000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/api/values",
|
|
"DownstreamScheme": "http",
|
|
"UpstreamPathTemplate": "/api/values",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "localhost",
|
|
"Port": 5007
|
|
}
|
|
],
|
|
"HttpHandlerOptions": {
|
|
"AllowAutoRedirect": true,
|
|
"UseCookieContainer": true,
|
|
"UseTracing": true
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "localhost",
|
|
"Port": 52876
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/identityserverexample",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
},
|
|
"AuthenticationOptions": {
|
|
"AuthenticationProviderKey": "TestKey",
|
|
"AllowedScopes": [
|
|
"openid",
|
|
"offline_access"
|
|
]
|
|
},
|
|
"AddHeadersToRequest": {
|
|
"CustomerId": "Claims[CustomerId] > value",
|
|
"LocationId": "Claims[LocationId] > value",
|
|
"UserType": "Claims[sub] > value[0] > |",
|
|
"UserId": "Claims[sub] > value[1] > |"
|
|
},
|
|
"AddClaimsToRequest": {
|
|
"CustomerId": "Claims[CustomerId] > value",
|
|
"LocationId": "Claims[LocationId] > value",
|
|
"UserType": "Claims[sub] > value[0] > |",
|
|
"UserId": "Claims[sub] > value[1] > |"
|
|
},
|
|
"AddQueriesToRequest": {
|
|
"CustomerId": "Claims[CustomerId] > value",
|
|
"LocationId": "Claims[LocationId] > value",
|
|
"UserType": "Claims[sub] > value[0] > |",
|
|
"UserId": "Claims[sub] > value[1] > |"
|
|
},
|
|
"RouteClaimsRequirement": {
|
|
"UserType": "registered"
|
|
},
|
|
"RequestIdKey": "OcRequestId"
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts",
|
|
"DownstreamScheme": "https",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 443
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"HttpHandlerOptions": {
|
|
"AllowAutoRedirect": true,
|
|
"UseCookieContainer": true
|
|
},
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts/{postId}",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts/{postId}",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"RequestIdKey": "ReRouteRequestId",
|
|
"HttpHandlerOptions": {
|
|
"AllowAutoRedirect": true,
|
|
"UseCookieContainer": true,
|
|
"UseTracing": true
|
|
},
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts/{postId}/comments",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts/{postId}/comments",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"HttpHandlerOptions": {
|
|
"AllowAutoRedirect": true,
|
|
"UseCookieContainer": true,
|
|
"UseTracing": false
|
|
},
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/comments",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/comments",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts",
|
|
"UpstreamHttpMethod": [ "Post" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts/{postId}",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts/{postId}",
|
|
"UpstreamHttpMethod": [ "Put" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts/{postId}",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts/{postId}",
|
|
"UpstreamHttpMethod": [ "Patch" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts/{postId}",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts/{postId}",
|
|
"UpstreamHttpMethod": [ "Delete" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/api/products",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/products",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
},
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/api/products/{productId}",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/products/{productId}",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/api/products",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/products",
|
|
"UpstreamHttpMethod": [ "Post" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/api/products/{productId}",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/products/{productId}",
|
|
"UpstreamHttpMethod": [ "Put" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
},
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts/",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
},
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "www.bbc.co.uk",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/bbc/",
|
|
"UpstreamHttpMethod": [ "Get" ]
|
|
}
|
|
],
|
|
|
|
"GlobalConfiguration": {
|
|
"RequestIdKey": "ot-traceid"
|
|
}
|
|
}
|