Aggregator: How can get parameter from first service and then use a data from response of the service as a parameter to next service? #1931
-
My requirement is I receive a parameter from client and pass it to my first downstream service and then use a data from response of the downstream service as a parameter to the next downstream service. Is it possible or not by using Ocelot? Please, provide one sample example by using .NET core with Ocelot. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Impossible now! FYIAggregator feature is not suitable place to define workflow steps, because the function of aggregator is combining all responses as one JSON response. |
Beta Was this translation helpful? Give feedback.
Impossible now!
You have described a kind of sequential process which can be started by first request.
This workflow should be defined somewhere.
So, Ocelot route syntax doesn't allow to link steps to define a workflow.
But in theory, everything is possible.
For now, you can define a route of first step.
Then, we have to define other steps, right?
I guess, the most appropriate place is custom Delegating Handler.
In the handler define the rest of your workflow steps, and link them.
As a result, return last step response from the handler back to upstream.
FYI
Aggregator feature is not suitable place to define workflow steps, because the function of aggregator is combining all responses as o…