java callout response size restrictions?

Not applicable

I have a java callout that computes a hash on the response message and stores it in a header. The client computes the hash and compares it to the header.

The client code correctly matches the hashes when the responses are small. When the response is 66K, the hash does not match. The request has Accept-Encoding set to gzip.

I removed the Accept-Encoding header from the request in the callout because the application server response content-type was gzip. But it did not help.

Q1. Does messageContext.getResponseMessage().getContent() take care of the gzip format?

Q2. Is there a size limitation in messageContext.getResponseMessage().getContent() which is preventing my hash computations?

Solved Solved
1 1 145
1 ACCEPTED SOLUTION

getContent() will return the uncompressed content, which is what I think you want.

I don't think there is a size limitation. I don't know of one.

If I were diagnosing this, I would test with iteratively larger payloads until I found one that breaks, and then I'd look for a specific difference in the payload. There may be some stray newlines getting trimmed or added quietly.

Can you check the content-length as well? Apigee Edge should set that. Compute it yourself in the Java callout by examining the stream (you already read it to compute the hash). and compare that to the response header received by the client. Same?

View solution in original post

1 REPLY 1

getContent() will return the uncompressed content, which is what I think you want.

I don't think there is a size limitation. I don't know of one.

If I were diagnosing this, I would test with iteratively larger payloads until I found one that breaks, and then I'd look for a specific difference in the payload. There may be some stray newlines getting trimmed or added quietly.

Can you check the content-length as well? Apigee Edge should set that. Compute it yourself in the Java callout by examining the stream (you already read it to compute the hash). and compare that to the response header received by the client. Same?