Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

JavaCallout Request Message is empty

We´ve been using javaCallouts for checking the content of requests, but since the latest update (Private EdgeCloud 4.19.01) we can not access this information.

Based on the example from here: https://github.com/apigee/api-platform-samples/blob/master/doc-samples/java-cookbook/callout/src/mai...

You can read the content and analyse it:

String content = messageContext.getMessage().getContent();

Or use a InputReader for longer Body:

messageContext.getRequestMessage().getContentAsStream()

My question is, does any body knows why this messageContext no longer allows access to the Payload?

Is there any other way for reading the Payload in Java?

Every Request returns empty content.

Thank you very much

Solved Solved
1 4 676
1 ACCEPTED SOLUTION

"we can not access this information"

What do you mean? It always returns an empty string?

That is surprising and sounds like a bug to me. But maybe it is because there is streaming enabled on the API? If not that, then please raise a bug with Apigee Edge support.

Have you tried

messageContext.getVariable("request.content") ;

?

View solution in original post

4 REPLIES 4