Key points for gRPC client streaming with Traffic Parrot:
- The client sends multiple request messages and the server responds with a single response.
- Traffic Parrot represents this as multiple mappings: one per client request message.
- Non-trigger requests (all except the last) have empty response bodies — they are "consumed" but produce no response.
- The trigger request (the last message sent before the client closes the stream) has the real response.
- Each mapping has a MessageNumber in the mapping file that represents the order of the requests.
- Each mapping has a CallId in the mapping file that groups requests belonging to the same RPC call.

In this example:
- These mappings form a client streaming request with 3 request messages and 1 response:
  * example.01.OrderService-SubmitOrder[consumed].json — first request (item-A), consumed with empty response
  * example.02.OrderService-SubmitOrder[consumed].json — second request (item-B), consumed with empty response
  * example.03.OrderService-SubmitOrder[OK].json — trigger request (item-C), produces the order confirmation response

- gRPC mappings are placed in the "grpc-mappings" directory
- gRPC proto files are placed in the "proto" directory
- The default non-TLS port is 5552

How client streaming replay works:
1. The client sends multiple messages to the stream.
2. Each message is matched against the mappings by request body.
3. Non-trigger mappings (empty response body) acknowledge the message without sending a response.
4. The trigger mapping (non-empty response body) sends the actual response and completes the call.

How client streaming recording works:
1. Traffic Parrot buffers all client messages until the client closes its send stream.
2. For each non-trigger message (all except the last), an empty-response mapping is created.
3. The last message (trigger) is sent along with all previous messages to the upstream server.
4. The upstream server's response is paired with the trigger request mapping.

Sample https://github.com/fullstorydev/grpcurl testing:

$ grpcurl -proto example.proto -emit-defaults -plaintext -d '{"itemId": "item-A", "quantity": 2} {"itemId": "item-B", "quantity": 1} {"itemId": "item-C", "quantity": 3}' localhost:5552 example.OrderService/SubmitOrder
{
  "orderId": "ORD-12345",
  "totalItems": 3,
  "status": "CONFIRMED"
}


For more information please contact support@trafficparrot.com
