5.7. 예
5.7.1. 생산자 예 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
구성 요소의 작동 방식을 완전히 이해하기 위해 이러한 통합 테스트를 살펴볼 수 있습니다.
5.7.2. 생산자 예 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
- CreateFunction: 이 작업은 AWS Lambda에서 기능을 생성합니다.
from("direct:createFunction").to("aws2-lambda://GetHelloWithName?operation=createFunction").to("mock:result");
자주하는 질문
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);
}
});