I'm using a ThrottleOverlay to control access to a memory intensive endpoint.
Inside the throttle the incoming requests are inspected by an arguments value size
and a variable issuedRequests is adapted accordingly. E.g. small size adds 1 and large
size adds 2 so with a concurrency of 4 throughput varies from maximal 4 to minimal
2. The problem is that inside the method
I need to know which response was sent back, one with a small or large size, to
adapt issuedRequests accordingly. I tried to set a header 'type' on the issued subrequest,
but inside receiveResponse I found no way to read this header:
- response.getHeaders() has no headers at all
- aContext.getThisRequest().getHeaders() has all the headers of the very first request
but not the header 'type' which was set on the subrequest
- inside the response is a private field mRequest which has all original headers plus
the header 'type' but I found no way to access them.
Is there a solution to mark a subrequest inside a throttle and then find it again
in the receiveResponse method without extra bookkeeping?
Thanks a lot,