-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Expected Behavior / New Feature
My json
{
"Routes": [
{
"DownstreamPathTemplate": "/comments",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5002
}
],
"UpstreamPathTemplate": "/comments",
"UpstreamHttpMethod": [
"GET"
],
"Key": "comments"
},
{
"DownstreamPathTemplate": "/users/{id}",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5001
}
],
"UpstreamPathTemplate": "/users/{id}",
"UpstreamHttpMethod": [
"GET"
],
"Key": "user"
}
],
"Aggregates": [
{
"UpstreamPathTemplate": "/aggregatecommentuser",
"RouteKeys": [
"comments",
"user"
],
"RouteKeysConfig": [
{
"RouteKey": "user",
"JsonPath": "$[*].userId",
"Parameter": "id"
}
]
}
],
"GlobalConfiguration": {
"BaseUrl": "https://localhost:5003"
}
}
I'm accessing the aggregating url: http://localhost:5003/aggregateСommentUser
The first request occurs for http://localhost:5002/comments
If my first query in the aggregation returns a response
"comments": [
{
"id": 1,
"userId": 1
},
{
"id": 2,
"userId": 2
}
],
Then when I request information about users, I should get a response.
"user": [
{
"id": 1,
"name": "Artem"
},
{
"id": 2,
"name": "Ivan"
}
]
And the requests themselves should look like this:
1. http://localhost:5002/comments
2. http://localhost:5001/users/1
3. http://localhost:5001/users/2
Actual Behavior / Motivation for New Feature
I'm accessing the aggregating url: http://localhost:5003/aggregateСommentUser
The first request occurs for http://localhost:5002/comments
my first query in the aggregation returns a response
"comments": [
{
"id": 1,
"userId": 1
},
{
"id": 2,
"userId": 2
}
],
I receive a response from the user service
"user": [
{
"id": 1,
"name": "Artem"
},
{
"id": 1,
"name": "Artem"
}
]
Because my requests from Ocelot look like this:
1. http://localhost:5002/comments
2. http://localhost:5001/users/1
3. http://localhost:5001/users/1
Link to the repository: https://github.com/ArtyomZhuravlyov/OcelotAggregate
Specifications
- Version: 23.4.2
- Platform: .NET 8
- Subsystem: