from("direct:createFunction").to("aws2-lambda://GetHelloWithName?operation=createFunction").to("mock:result");
from("direct:createFunction").to("aws2-lambda://GetHelloWithName?operation=createFunction").to("mock:result");
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
template.send("direct:createFunction", ExchangePattern.InOut, new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader(Lambda2Constants.RUNTIME, "nodejs6.10");
exchange.getIn().setHeader(Lambda2Constants.HANDLER, "GetHelloWithName.handler");
exchange.getIn().setHeader(Lambda2Constants.DESCRIPTION, "Hello with node.js on Lambda");
exchange.getIn().setHeader(Lambda2Constants.ROLE,
"arn:aws:iam::643534317684:role/lambda-execution-role");
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(
classLoader
.getResource("org/apache/camel/component/aws2/lambda/function/node/GetHelloWithName.zip")
.getFile());
FileInputStream inputStream = new FileInputStream(file);
exchange.getIn().setBody(inputStream);
}
});
template.send("direct:createFunction", ExchangePattern.InOut, new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader(Lambda2Constants.RUNTIME, "nodejs6.10");
exchange.getIn().setHeader(Lambda2Constants.HANDLER, "GetHelloWithName.handler");
exchange.getIn().setHeader(Lambda2Constants.DESCRIPTION, "Hello with node.js on Lambda");
exchange.getIn().setHeader(Lambda2Constants.ROLE,
"arn:aws:iam::643534317684:role/lambda-execution-role");
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(
classLoader
.getResource("org/apache/camel/component/aws2/lambda/function/node/GetHelloWithName.zip")
.getFile());
FileInputStream inputStream = new FileInputStream(file);
exchange.getIn().setBody(inputStream);
}
});
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow