我有一个特定的功能需求,需要将所有等待消息从 SQS 累积到我的 apache Camel 组件,并在其中编写业务逻辑。
我正在使用两个带有单个负载均衡器的 ec2 实例。
假设我向队列发送 100 条消息。在 100 条消息中,有 x 条消息将发送至实例 A,(100-x) 条消息将发送至实例 B。因此,我无法在单个实例中累积所有 100 条消息。
Is there any way, I can send the SQS messages to a particular EC2 instance only
OR
I can send the messages from one EC2 to other EC2 instance. Note: Both EC2 instances are running on same port.
最佳答案
您可以使用 SNS-SQS 扇出方案将消息从一个源传递到多个队列。这样每个实例都可以从自己单独的队列中提取消息。
我不确定整个架构,但这不是重点。
https://aws.amazon.com/getting-started/hands-on/send-fanout-event-notifications/
关于java - 连接两个 AWS EC2 实例以将数据从一个 EC2 实例共享到另一 EC2 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61540755/