AWS Lambda Java response streaming appears to expect a JSON-compatible response. The handler exposes an OutputStream, so I tried writing raw bytes directly with `output.write("SSSSSSSSSSSSSSSSSSS".getBytes())`, but the Function URL returned an Internal Server Error. Wrapping the same text in a JSON array, such as `["SSSSSSSSSSSSSSSSSSS"]`, worked. Buffered Java responses under 6 MB already work, and Node.js streaming also works, but I'm trying to stream larger responses from the Java runtime through a Function URL. Is Java response streaming supported, or is there a required response format or different configuration?
3 Answers
The managed runtime documentation has historically shown response streaming primarily for Node.js, while buffered responses are documented for more runtimes. If Java streaming is not supported by the managed Java runtime, you may need a custom runtime or adapter that implements Lambda’s streaming protocol. Otherwise, Java will likely need to use buffered responses or return a JSON-compatible value.
I’d also check the Lambda logs for the actual Internal Server Error. Changing Java versions and CPU architecture probably won’t affect this if the issue is an unsupported response mode, but the logs should confirm whether the failure is coming from serialization, the Function URL integration, or the streaming protocol.
The JSON-wrapped version working suggests Lambda is successfully interpreting the response envelope, while the plain text is not being handled as a valid response for the invocation path you’re using. Writing bytes to an OutputStream alone may not be enough; the streaming-specific integration has to be enabled and used rather than a normal buffered Function URL response.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically