Sandbox provides you with the 3 options (in the 1.3.0 RC, 1.2.0 only has 2 iirc) to configure the limits that determine when you get a backpressure response:
Maximum number of submitted commands waiting for completion for each party (only applied when using the CommandService). Overflowing this threshold will cause back-pressure, signaled by a RESOURCE_EXHAUSTED error code. Default is 256.
Maximum number of successfully interpreted commands waiting to be sequenced (applied only when running sandbox-classic). The threshold is shared across all parties. Overflowing it will cause back-pressure, signaled by a RESOURCE_EXHAUSTED error code. Default is 512.
The maximum number of commands waiting to be submitted for each party. Overflowing this threshold will cause back-pressure, signaled by a RESOURCE_EXHAUSTED error code. Default is 512.
If you lower them it should be much easier to get a backpressure response for sandbox.
As for capturing the response, ideally you would just match on
RESOURCE_EXHAUSTED but unfortunately that includes non-backpressure responses as well. That behavior comes from the underlying gRPC library so unfortunately we cannot change this. Maybe someone else has a good idea here for only matching on backpressure responses.