mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 22:28:15 +08:00
Rename all ReRoute to Route to move closer to YARP +semver: breaking
This commit is contained in:
@ -18,19 +18,19 @@ In your ocelot.json set the following in the GlobalConfiguration section. This w
|
||||
"RequestIdKey": "OcRequestId"
|
||||
}
|
||||
|
||||
I recommend using the GlobalConfiguration unless you really need it to be ReRoute specific.
|
||||
I recommend using the GlobalConfiguration unless you really need it to be Route specific.
|
||||
|
||||
*ReRoute*
|
||||
*Route*
|
||||
|
||||
If you want to override this for a specific ReRoute add the following to ocelot.json for the specific ReRoute.
|
||||
If you want to override this for a specific Route add the following to ocelot.json for the specific Route.
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
"RequestIdKey": "OcRequestId"
|
||||
|
||||
Once Ocelot has identified the incoming requests matching ReRoute object it will set the request id based on the ReRoute configuration.
|
||||
Once Ocelot has identified the incoming requests matching Route object it will set the request id based on the Route configuration.
|
||||
|
||||
This can lead to a small gotcha. If you set a GlobalConfiguration it is possible to get one request id until the ReRoute is identified and then another after that because the request id key can change. This is by design and is the best solution I can think of at the moment. In this case the OcelotLogger will show the request id and previous request id in the logs.
|
||||
This can lead to a small gotcha. If you set a GlobalConfiguration it is possible to get one request id until the Route is identified and then another after that because the request id key can change. This is by design and is the best solution I can think of at the moment. In this case the OcelotLogger will show the request id and previous request id in the logs.
|
||||
|
||||
Below is an example of the logging when set at Debug level for a normal request..
|
||||
|
||||
@ -41,7 +41,7 @@ Below is an example of the logging when set at Debug level for a normal request.
|
||||
dbug: Ocelot.DownstreamRouteFinder.Middleware.DownstreamRouteFinderMiddleware[0]
|
||||
requestId: asdf, previousRequestId: no previous request id, message: upstream url path is {upstreamUrlPath},
|
||||
dbug: Ocelot.DownstreamRouteFinder.Middleware.DownstreamRouteFinderMiddleware[0]
|
||||
requestId: asdf, previousRequestId: no previous request id, message: downstream template is {downstreamRoute.Data.ReRoute.DownstreamPath},
|
||||
requestId: asdf, previousRequestId: no previous request id, message: downstream template is {downstreamRoute.Data.Route.DownstreamPath},
|
||||
dbug: Ocelot.RateLimit.Middleware.ClientRateLimitMiddleware[0]
|
||||
requestId: asdf, previousRequestId: no previous request id, message: EndpointRateLimiting is not enabled for Ocelot.Values.PathTemplate,
|
||||
dbug: Ocelot.Authorisation.Middleware.AuthorisationMiddleware[0]
|
||||
|
Reference in New Issue
Block a user