如何使用 apache camel 创建 IAM 用户?
How to create an IAM User using apache camel?
我有骆驼休息api。我试图使用 apache camel 框架创建一个 IAM 用户。代码是这样的 ->
.post("iam-create-user")
.route()
.process(new Processor(){
@Override
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader("CamelAwsIAMUsername", "new-user");
})
.to("aws2-iam://current-user?accessKey=insert&secretKey=insert&operation=createUser")
.endRest();
我收到此错误 java.lang.NullPointerException: null
。这样做的正确方法是什么?它在 camel 文档中显示使用 URL 像这样 to("aws2-iam://test?iamClient=#amazonIAMClient&operation=createUser")
。我们把什么写成iamClient
?
示例中报告的 iamClient (#amazonIAMClient) 是一个 IAMClient 实例,您需要使用绑定名称 amazonIAMClient 将其放入 Camel 注册表中。
我认为您需要为此特定组件将区域指定为 aws-global。
也许添加错误的完整堆栈跟踪。
我有骆驼休息api。我试图使用 apache camel 框架创建一个 IAM 用户。代码是这样的 ->
.post("iam-create-user")
.route()
.process(new Processor(){
@Override
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader("CamelAwsIAMUsername", "new-user");
})
.to("aws2-iam://current-user?accessKey=insert&secretKey=insert&operation=createUser")
.endRest();
我收到此错误 java.lang.NullPointerException: null
。这样做的正确方法是什么?它在 camel 文档中显示使用 URL 像这样 to("aws2-iam://test?iamClient=#amazonIAMClient&operation=createUser")
。我们把什么写成iamClient
?
示例中报告的 iamClient (#amazonIAMClient) 是一个 IAMClient 实例,您需要使用绑定名称 amazonIAMClient 将其放入 Camel 注册表中。
我认为您需要为此特定组件将区域指定为 aws-global。
也许添加错误的完整堆栈跟踪。