I
- The request body typeO
- The response body typepublic abstract class MicronautRequestHandler<I,O> extends io.micronaut.function.executor.AbstractFunctionExecutor<I,O,com.amazonaws.services.lambda.runtime.Context> implements com.amazonaws.services.lambda.runtime.RequestHandler<I,O>, MicronautLambdaContext
An Amazon Lambda RequestHandler
implementation for Micronaut FunctionBean
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ENV_X_AMZN_TRACE_ID |
static java.lang.String |
LAMBDA_TRACE_HEADER_PROP |
static java.lang.String |
MDC_DEFAULT_AWS_REQUEST_ID
Deprecated.
Use the bena of type
DiagnosticInfoPopulator instead. |
static java.lang.String |
MDC_DEFAULT_FUNCTION_ARN
Deprecated.
Use the bena of type
DiagnosticInfoPopulator instead. |
static java.lang.String |
MDC_DEFAULT_FUNCTION_MEMORY_SIZE
Deprecated.
Use the bena of type
DiagnosticInfoPopulator instead. |
static java.lang.String |
MDC_DEFAULT_FUNCTION_NAME
Deprecated.
Use the bena of type
DiagnosticInfoPopulator instead. |
static java.lang.String |
MDC_DEFAULT_FUNCTION_REMAINING_TIME
Deprecated.
Use the bena of type
DiagnosticInfoPopulator instead. |
static java.lang.String |
MDC_DEFAULT_FUNCTION_VERSION
Deprecated.
Use the bena of type
DiagnosticInfoPopulator instead. |
static java.lang.String |
MDC_DEFAULT_XRAY_TRACE_ID
Deprecated.
Use the bena of type
DiagnosticInfoPopulator instead. |
ENVIRONMENT_LAMBDA
Constructor and Description |
---|
MicronautRequestHandler()
Default constructor; will initialize a suitable
ApplicationContext for
Lambda deployment. |
MicronautRequestHandler(io.micronaut.context.ApplicationContext applicationContext)
Constructor used to inject a preexisting
ApplicationContext . |
MicronautRequestHandler(io.micronaut.context.ApplicationContextBuilder applicationContextBuilder)
Constructor used to inject a preexisting
ApplicationContextBuilder . |
Modifier and Type | Method and Description |
---|---|
protected io.micronaut.context.ApplicationContext |
buildApplicationContext(com.amazonaws.services.lambda.runtime.Context context) |
protected I |
convertInput(java.lang.Object input)
Converts the input the required type.
|
O |
handleRequest(I input,
com.amazonaws.services.lambda.runtime.Context context) |
protected void |
mdcput(java.lang.String key,
java.lang.String val)
Deprecated.
Use
DiagnosticInfoPopulator instead. |
protected io.micronaut.context.ApplicationContextBuilder |
newApplicationContextBuilder() |
protected static java.util.Optional<java.lang.String> |
parseXrayTraceId()
Deprecated.
Use
XRayUtils.parseXrayTraceId() instead. |
protected void |
populateMappingDiagnosticContextValues(com.amazonaws.services.lambda.runtime.Context context)
Deprecated.
Use
DiagnosticInfoPopulator instead. |
protected void |
populateMappingDiagnosticContextWithXrayTraceId()
Deprecated.
Use
DiagnosticInfoPopulator instead. |
close, getApplicationContext, resolveFunction, resolveFunctionName, startEnvironment
public static final java.lang.String ENV_X_AMZN_TRACE_ID
public static final java.lang.String LAMBDA_TRACE_HEADER_PROP
@Deprecated public static final java.lang.String MDC_DEFAULT_AWS_REQUEST_ID
DiagnosticInfoPopulator
instead.@Deprecated public static final java.lang.String MDC_DEFAULT_FUNCTION_NAME
DiagnosticInfoPopulator
instead.@Deprecated public static final java.lang.String MDC_DEFAULT_FUNCTION_VERSION
DiagnosticInfoPopulator
instead.@Deprecated public static final java.lang.String MDC_DEFAULT_FUNCTION_ARN
DiagnosticInfoPopulator
instead.@Deprecated public static final java.lang.String MDC_DEFAULT_FUNCTION_MEMORY_SIZE
DiagnosticInfoPopulator
instead.@Deprecated public static final java.lang.String MDC_DEFAULT_FUNCTION_REMAINING_TIME
DiagnosticInfoPopulator
instead.@Deprecated public static final java.lang.String MDC_DEFAULT_XRAY_TRACE_ID
DiagnosticInfoPopulator
instead.public MicronautRequestHandler()
ApplicationContext
for
Lambda deployment.public MicronautRequestHandler(io.micronaut.context.ApplicationContext applicationContext)
ApplicationContext
.applicationContext
- the application contextpublic MicronautRequestHandler(io.micronaut.context.ApplicationContextBuilder applicationContextBuilder)
ApplicationContextBuilder
.applicationContextBuilder
- the application context builderpublic final O handleRequest(I input, com.amazonaws.services.lambda.runtime.Context context)
@Deprecated protected void populateMappingDiagnosticContextValues(@NonNull com.amazonaws.services.lambda.runtime.Context context)
DiagnosticInfoPopulator
instead.context
- The Lambda execution environment context object.@Deprecated protected void mdcput(@NonNull java.lang.String key, @NonNull java.lang.String val) throws java.lang.IllegalArgumentException
DiagnosticInfoPopulator
instead.key
- non-null keyval
- value to put in the mapjava.lang.IllegalArgumentException
- in case the "key" parameter is null@Deprecated protected void populateMappingDiagnosticContextWithXrayTraceId()
DiagnosticInfoPopulator
instead.@NonNull @Deprecated protected static java.util.Optional<java.lang.String> parseXrayTraceId()
XRayUtils.parseXrayTraceId()
instead.protected I convertInput(java.lang.Object input)
input
- The inputjava.lang.IllegalArgumentException
- If input cannot be convertedprotected io.micronaut.context.ApplicationContext buildApplicationContext(com.amazonaws.services.lambda.runtime.Context context)
buildApplicationContext
in class io.micronaut.function.executor.AbstractExecutor<com.amazonaws.services.lambda.runtime.Context>
@NonNull protected io.micronaut.context.ApplicationContextBuilder newApplicationContextBuilder()
newApplicationContextBuilder
in class io.micronaut.function.executor.AbstractExecutor<com.amazonaws.services.lambda.runtime.Context>