Comments (10)
Dear Tang,
We can't accept this short description and reproduce your problem!
Could you please provide additional details on the issue? Such as logs, configuration JSON, and the health check status of the downstream service, etc.?
Additionally, you may pose questions in the Discussions space.
from ocelot.
This is an obvious and simple bug, and I have tried to print some logs for your reference.
from ocelot.
downstream service status is normal, success open by Url , when i comment "ExceptionsAllowedBeforeBreaking" or "TimeoutValue",everything will be OK
from ocelot.
downstream service status is normal, success open by Url , when i comment "ExceptionsAllowedBeforeBreaking" or "TimeoutValue",everything will be OK
try to add "DurationOfBreak": yourValue in QoS Section
from ocelot.
when i comment "ExceptionsAllowedBeforeBreaking" or "TimeoutValue",everything will be OK
If the route works well without enabled QoS, then why are you writing us and reporting the issue?
Read the docs → QoS
If you have more questions then post them to Q-&-A discussions❗
As a team, we don't see any issues with Ocelot. There is misconfiguration issue of your ocelot.json
from ocelot.
@RaynaldM It can be a bug...
- use follow two configuration items together:
"QoSOptions": { "ExceptionsAllowedBeforeBreaking": 3, "TimeoutValue": 3000 }
So, possibly absence of DurationOfBreak
can generate an exception. But I wonder if there is no default value for DurationOfBreak
.
It seems we have to investigate this case...
from ocelot.
downstream service status is normal, success open by Url , when i comment "ExceptionsAllowedBeforeBreaking" or "TimeoutValue",everything will be OK
try to add "DurationOfBreak": yourValue in QoS Section
actually, I have already configured this item, but the problem is not with it
from ocelot.
when i comment "ExceptionsAllowedBeforeBreaking" or "TimeoutValue",everything will be OK
If the route works well without enabled QoS, then why are you writing us and reporting the issue? Read the docs → QoS
If you have more questions then post them to Q-&-A discussions❗
As a team, we don't see any issues with Ocelot. There is misconfiguration issue of your
ocelot.json
My configurations are all from official documents , so why do you think there is misconfiguration of my ocelot.json? and why not confirm if this issue exists?
from ocelot.
{
"Routes": [
{
"UpstreamPathTemplate": "/profile",
"UpstreamHttpMethod": [ "Get" ], //TODO 这里配置options是否可以直接处理预检请求?如果不行还是自定义一个中间件来实现
"DownstreamPathTemplate": "/profile",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5001
}
],
"DownstreamHeaderTransform": {
"Access-Control-Allow-Oringin": "http://localhost:8070" //允许前端地址跨域
},
// 熔断设置
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 3, //允许多少个异常请求
"DurationOfBreak": 1000, // 熔断的时间,单位为ms
"TimeoutValue": 5000 //单位ms 如果下游请求的处理时间超过多少则自如将请求设置为超时 默认90秒
}
},
{
"UpstreamPathTemplate": "/order/swagger/v1/swagger.json",
"UpstreamHttpMethod": [ "Get" ],
"DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5931
}
]
},
{
"UpstreamPathTemplate": "/user/swagger/v1/swagger.json",
"UpstreamHttpMethod": [ "Get" ],
"DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5930
}
]
}
],
"GlobalConfiguration": {
"RequestIdKey": "ot-traceid"
}
}
this is my ocelot.json
from ocelot.
Define Catch All route for /user
and /order
paths and forget about the issue:
"UpstreamPathTemplate": "/order/{catchAll}",
"DownstreamPathTemplate": "/{catchAll}",
and
"UpstreamPathTemplate": "/user/{catchAll}",
"DownstreamPathTemplate": "/{catchAll}",
Also you need define all possible HTTP verbs.
Better to define Catch All for profile
paths too:
"UpstreamPathTemplate": "/profile/{all}",
"DownstreamPathTemplate": "/profile/{all}",
Hope it helps!
from ocelot.
Related Issues (20)
- In C#, when using Ocelot, the ContentLength is 0 when forwarding data to downstream services. HOT 1
- Polly V7 syntax is no longer supported
- `FailureRatio` and `SamplingDuration` parameters of Polly V8 circuit-breaker
- After upgrade to Ocelot 23.2, `ocelot.global.json` file no longer gets merged correctly HOT 9
- Circuit Breaker behavior in Polly v7 vs v8 HOT 1
- Request Body Not Considered in Ocelot Cache Key Calculation HOT 7
- NuGet issues aka `PublishToNuget` release target task HOT 1
- Routing issue when use {Literals} at last
- 'authorization' is missing in Access-Control-Allow-Headers only in a specific request HOT 4
- SignalR no connection in `ws` mode HOT 1
- Is ocelot support sharing routes and rate limit configuration between it's instances if we publish more than one ocelot instance ?
- Error Code: UnableToFindDownstreamRouteError (404) HOT 1
- After Upgrade to 23.3.3 from 23.2.2 cluster name is being used in place of service address HOT 9
- After Upgrade to 23.3.3 from 23.2.2 about every 20th - 30th request finished with status code 500 HOT 42
- Invalid pattern ** HOT 1
- Injection middleware not working HOT 2
- `Regex` exception when route template placeholder contains invalid character ')' HOT 12
- help me ocelot+consul has 404 HOT 3
- Concurrent requests with different services, using consul, returns the same service and then 404 HOT 19
- IIS Windows Auth Intermittent 401.1 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ocelot.