vahidaghazadeh commented on PR #12128:
URL: https://github.com/apache/apisix/pull/12128#issuecomment-2789733029

   > Is this similar to the plug-in 
[batch-request](https://apisix.apache.org/docs/apisix/plugins/batch-requests/)?
   
   No, this plugin is different from the batch-requests plugin in several ways.
   
   Key Differences:
   1. Purpose:
   
   Your plugin (proxy-chain) is designed to sequentially call multiple backend 
services, merge their responses, and forward the final merged data to the 
upstream.
   
   batch-requests allows clients to send multiple requests in a single HTTP 
call, and it executes them in parallel (or optionally in sequence), returning 
all responses back to the client as a batch.
   
   2. Response Handling:
   
   proxy-chain merges the responses of the services into one unified request 
body that is then forwarded upstream.
   
   batch-requests returns the raw responses of each sub-request as separate 
items in an array.
   
   3. Flow Direction:
   
   proxy-chain is used in the request phase, before the final upstream is 
called. It acts as a transformation layer before reaching the main backend.
   
   batch-requests is mostly client-driven — clients explicitly request multiple 
things, and the plugin acts more like a batch router.
   
   4. Use Case:
   
   Use proxy-chain when you want to call multiple internal services, combine 
their outputs, and proceed with the final data as if it was one logical request.
   
   Use batch-requests when a frontend or client needs to hit multiple endpoints 
in a single API call and receive all results independently.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to