@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 | Method and Description |
|---|---|
default java.lang.String |
alias() |
default void |
init(io.vertx.core.Vertx vertx)
Default initialization.
|
Copyright © 2019. All Rights Reserved.