I can find lots of information on writing directly to the output stream from an AWS Lambda function written in Java, but I can't find any information on how to get that stream in the Java AWS Lambda SDK so that I can bind the resulting inputstream to the outputstream within our API (the client of the Lambda function). Does anyone know how I can do this? All I can find in the InvokeResult is getPayload() which is a ByteBuffer. If I use this, it implies that the entire stream is loaded into the memory of the buffer before I can forward it back out of our API. We're returning PDF documents, but I guess the same applies to any binary stream.
Flow looks like:
UI --> Our API (assembles Lambda function input JSON) --> AWS Lambda Function
UI <-- Our API (directly streams Lambda response to UI - hopefully) <-- AWS Lambda Function