Skip to content

Add streamProxy method to container handler #118

@sapessi

Description

@sapessi
  • Framework version: 1.0
  • Implementations: Jersey / Spring / Spring Boot / Spark

Add a new streamProxy(InputStream, OutputStream, Context) method to the LambdaContainerHandler object.

Scenario

Simplifies the task of writing Lambda RequestStreamHandler` classes from:

@Override
public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context)
			throws IOException {
	AwsProxyRequest request = LambdaContainerHandler.getObjectMapper().readValue(inputStream, AwsProxyRequest.class);
	AwsProxyResponse resp = handler.proxy(request, context);
	LambdaContainerHandler.getObjectMapper().writeValue(outputStream, resp);
        outputStream.close();
}

to:

@Override
public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context)
			throws IOException {
	handler.streamProxy(inputStream, outputStream, context);
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions