Replies: 4 comments 11 replies
-
Complex Aggregation docsOcelot/docs/features/requestaggregation.rst Lines 69 to 70 in 58d87c9
|
Beta Was this translation helpful? Give feedback.
-
I made a fork allowing me to manage sequential calls and I can see about integrating it into the official version if you want, but you have to be sure that what I develop corresponds to what you want. In theory, I would keep a default operation as it currently exists. But if we activate an option in the config file (sequential = false) then the calls to the micro-services are no longer done automatically. We must then manually call the micro-services in the aggregator as in the following example: await Fire(contexts[0], next);
var response1 = GetResponse(contexts[0]);
var result1 = await GetResult<ExampleApiMessage>(response1);
SetQueryString(contexts[1], new QueryString("?id=4¶meter=" + result1.message));
await Fire(contexts[1], next);
var response2 = GetResponse(contexts[1]);
var result2 = await GetResult<IExampleData>(response2);
var result = new AggregateData(result1, result2);
return Return(result); Remark : with sequential aggregations, it seems useful to me to authorize POST type calls (see FileAggregateRoute.cs, UpstreamHttpMethod). But in your code you write : Only supports GET..are you crazy!! POST, PUT WOULD BE CRAZY!! :) |
Beta Was this translation helpful? Give feedback.
-
Hello and thank you for this very detailed feedback. |
Beta Was this translation helpful? Give feedback.
-
@raman-m FYI → #1389 the quality of PR is very low. But I keep this PR open for "other verbs" functionality. Allow POST on FileAggregateRoute would be great :-) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Expected Behavior / New Feature
Currently when using the query aggregators all the calls merge synchronously.
In some cases it may be interesting to ensure that these calls are made synchronously:
I made the change on a personal fork, it is quite easy to set up (I started from the principle that by default the parameters are pre-filled identically for all requests.
Here is an example of use:
As soon as calls become sequential, it becomes interesting to allow POST-type requests on aggregators. So I also removed this limitation. Here is an example of using with an aggregator with POST and GET:
My code is not very sexy I admit it because I made sure that there is the least code that differs from the original. I think that ideally there should be more automatic things via the configuration server.
Actual Behavior / Motivation for New Feature
Remove a very strong limitation of Ocelot
Beta Was this translation helpful? Give feedback.
All reactions