All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.amazon.lambda.runtime.QuarkusStreamHandler Maven / Gradle / Ivy

There is a newer version: 3.17.0
Show newest version
package io.quarkus.amazon.lambda.runtime;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestStreamHandler;

import io.quarkus.runtime.Quarkus;

/**
 * Intended to be used within a java runtime lambda deployment.
 * This handler is a tiny wrapper for the app-developer-defined lambda handler.
 * It delegates to a wrapper that uses arc to instantiate the
 * app-developer's handler. Jackson is used to (de)serialize input and output types of app-dev's handler.
 *
 */
public class QuarkusStreamHandler implements RequestStreamHandler {
    public QuarkusStreamHandler() {
        Quarkus.manualInitialize();
    }

    @Override
    public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) throws IOException {
        Quarkus.manualStart();
        AmazonLambdaRecorder.handle(inputStream, outputStream, context);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy