@FunctionalInterface
public interface Lambda<T>
extends io.vertx.core.Handler<io.vertx.core.eventbus.Message<T>>
(msg) -> {
System.out.println(msg.body());
msg.reply(new JsonObject().put("hello", "world"));
}
The message body is an object that contains the payload that's provided by the invoker. If the payload is a JSON
document, the event object is a JsonObject. Otherwise, it's a Buffer. The Message object has
methods and properties that provide information about the invocation, the headers, and the execution environment.
The handler is executed every time your Lambda function is invoked. Static code outside of the handler or the
init(Vertx) method is executed once per instance of the function. If your handler uses resources like
SDK clients and database connections, you can create them outside of the handler method to reuse them for multiple
invocations.
Each instance of your lambda can process multiple invocation events, but it only processes one event at a time.
The number of instances processing an event at any given time is your function's concurrency. For more information
about the Lambda execution context, see AWS Lambda Execution Context.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
LAMBDA_RUNTIME_AWS_REQUEST_ID |
static java.lang.String |
LAMBDA_RUNTIME_CLIENT_CONTEXT |
static java.lang.String |
LAMBDA_RUNTIME_COGNITO_IDENTITY |
static java.lang.String |
LAMBDA_RUNTIME_DEADLINE_MS |
static java.lang.String |
LAMBDA_RUNTIME_INVOKE_FUNCTION_ARN |
static java.lang.String |
LAMBDA_RUNTIME_TRACE_ID |
| Modifier and Type | Method and Description |
|---|---|
default void |
init(io.vertx.core.Vertx vertx)
Default initialization.
|
static final java.lang.String LAMBDA_RUNTIME_AWS_REQUEST_ID
static final java.lang.String LAMBDA_RUNTIME_DEADLINE_MS
static final java.lang.String LAMBDA_RUNTIME_INVOKE_FUNCTION_ARN
static final java.lang.String LAMBDA_RUNTIME_TRACE_ID
static final java.lang.String LAMBDA_RUNTIME_CLIENT_CONTEXT
static final java.lang.String LAMBDA_RUNTIME_COGNITO_IDENTITY
Copyright © 2019. All Rights Reserved.