You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I’m using Kong to front my backend services, and I have a requirement that goes beyond a simple static proxy:
I need to expose a single endpoint, for example: GET /api/test?CoopCode=111,222,333
(or by passing those comma-separated values in a header).
At runtime, Kong should split that CoopCode parameter into its individual values (111, 222, 333), and for each one:
Issue a separate request to the same upstream service endpoint.
Collect each JSON response.
Finally, Kong should aggregate all of those individual responses into one single JSON payload (for instance, an array of results) and return it to the client.
My questions are:
Native support: Is there any way in Kong’s core or its existing plugins to perform this kind of dynamic “fan-out and aggregate” behavior without pre-defining a fixed number of Services/Routes or writing custom code in each configuration?
Custom plugin: If I do need a custom plugin, do you have any reference examples—either in Lua (for Kong OSS) or Go (for Kong Gateway)—that demonstrate dynamic request fan-out and response aggregation?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I’m using Kong to front my backend services, and I have a requirement that goes beyond a simple static proxy:
I need to expose a single endpoint, for example:
GET /api/test?CoopCode=111,222,333
(or by passing those comma-separated values in a header).
At runtime, Kong should split that CoopCode parameter into its individual values (111, 222, 333), and for each one:
Finally, Kong should aggregate all of those individual responses into one single JSON payload (for instance, an array of results) and return it to the client.
My questions are:
Native support: Is there any way in Kong’s core or its existing plugins to perform this kind of dynamic “fan-out and aggregate” behavior without pre-defining a fixed number of Services/Routes or writing custom code in each configuration?
Custom plugin: If I do need a custom plugin, do you have any reference examples—either in Lua (for Kong OSS) or Go (for Kong Gateway)—that demonstrate dynamic request fan-out and response aggregation?
Thanks in advance for any guidance or pointers!
Beta Was this translation helpful? Give feedback.
All reactions