简体   繁体   中英

Subscribing SNS to SQS in AWS?

Looking at this image :

在此处输入图片说明

The messages are really imporant hence I use a queue in the middle. But now - On the right side SNS , I need to have multiple subscribers ( Lambdas).

But now, How can I subscribe the right side SNS to the SQS on the center ?

Question:

Is it possible to subscribe SNS to SQS ? ( meaning - passing the messages from SQS to an SNS)

SNS is a topic, it does not subscribe to anything. It cannot receive data, it needs to be published to.

However, you can publish to it from an application code. For this, you can attach a consumer to your SQS in the middle. This could be a Java application or a simple lambda code.

Here are a few references for doing it in various languages.

  1. Java and .NET
  2. Python
  3. Node JS

First of all create a new Lambda function to send message to a SNS topic . Refer this - https://github.com/aws-samples/serverless-app-examples/tree/master/python/step-functions-send-to-sns

And then you can configure your queue to trigger that Lambda function on receiving of payload.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM