将AMQ与Rest API网关集成 [英] Integrating AMQ with Rest API gateway

查看:101
本文介绍了将AMQ与Rest API网关集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将AMQ与api网关集成在一起,以便我可以使用API​​网关中的AWS资源选项将消息直接从api网关推送到AMQ,并在集成的部署AWS ARN上收到此错误消息.

I am trying to integrate AMQ with api gateway so that i can push messages directly to AMQ from api gateway using AWS resource option in API gateway and gets this error on deployment AWS ARN for integration contains invalid action.

我应该在此处使用什么操作,以便api gatwway知道应该使用哪个AMQ来推送消息.

What action should i use here so that api gatwway know which AMQ it should use to push messages.

我需要注意什么,以便我可以使用AMQ设置apigateway

what all the things i need to take care so that i can setup apigateway with AMQ

推荐答案

要将Amazon MQ与API Gateway集成,您将无法使用"AWS Service"集成.原因是,"AWS服务"集成仅在AWS MQ Management API公开了将消息发送到MQ Broker的操作时才有用.但是,如果您看一下MQ API [1]公开的操作,它们仅提供管理操作.这就是原因,您不能在用例中使用"AWS服务"集成.

For integrating Amazon MQ with API Gateway, you will not be able to use the "AWS Service" integration. The reason is, "AWS Service" integration is only helpful if the AWS MQ Management API expose an operation to send messages to a MQ Broker. But if you look at the operations exposed by MQ API [1] they just offer the management operations. This is the reason, you cannot use "AWS Service" integration for your use case.

因此,如果您的API需要连接到MQ Broker并发送消息,则建议您的API需要使用"Lambda函数"集成.要了解更多信息,我建议使用以下文档[2].

So if your API needs to connect to a MQ Broker and send message, I would suggest your API need to use "Lambda function" integration. To understand more about this, I would recommend to use the following documentation [2].

然后,您可以实现Lambda函数,该函数初始化消息生产者并发送消息.有关实现消息生成器并发送消息的特定源代码,请参阅[3]中标题为第2步:将Java应用程序连接到您的代理"的部分.

Then you can implement a Lambda function that initializes a message producer and send the message. For specific source code to implement the message producer and send the message please refer to the section titled "Step 2: Connect a Java Application to Your Broker" in [3].

[1] https://docs.aws. amazon.com/cli/latest/reference/mq/index.html

[2] https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-api-as-simple-proxy-for-lambda.html

[3] https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-getting-started.html#connect-java-application

这篇关于将AMQ与Rest API网关集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆