PubNub Integration

Amazon SQS – Fully managed message queues

External APIs

External APIs

Alerts & Notifications

Alerts & Notifications

Data Streaming & Dashboards

Data Streaming & Dashboards

Geo / Location Tracking

Geo / Location Tracking

Last Updated:





Fully managed message queues for microservices, distributed systems, and serverless applications

Amazon Simple Queue Service (Amazon SQS) offers a secure, durable, and available hosted queue that lets you integrate and decouple distributed software systems and components. Amazon SQS offers common constructs such as dead-letter queues and cost allocation tags. It provides a generic web services API and it can be accessed by any programming language that the AWS SDK supports.

Amazon SQS supports both standard and FIFO queues.


  1. Sign-up for an AWS account and setup the SQS queue(s).

  2. Sign-up for a PubNub account, if you don't have one already.

  3. Import the Integration Block into your PubNub account. You can choose to add this to an existing application or create a new one.

  4. Configure the Integration Block module code, connecting it to your AWS account:

    1. Create a Secret in PubNub Vault, named AWS_ACCESS_KEY_ID, with value equal to your AWS Access Key ID for this service.

    2. Create a Secret in PubNub Vault, named AWS_SECRET_KEY, with value equal to your AWS Secret Key for this service.

    3. Create a Secret in PubNub Vault, named AWS_REGION, with value equal to your AWS Region for the target queue .

    4. Create a Secret in PubNub Vault, named AWS_ACCOUNT_NUMBER, with value equal to your AWS Account ID for this service.

  5. Start the Integration Block module.

  6. Try a test message (you can click on Publish to do this).


This Integration Block is setup to listen to a specific PubNub channel (CHANNEL-to-send-to-SQS) but you can configure it to listen to all channels or a subset, using wildcards, e.g. chat.*. Thus, you can route message data sent through PubNub over to an Amazon SQS for fan-in use cases, for example. The target queue name can be set in the functions code or controlled through message metadata. In publish metadata, the customization properties are set as part of a JSON object specific for the function named aws-sqs-v1.

  1. TARGET_QUEUE_NAME: name of the queue that the message should be sent to

Example publish metadata:

{"functions": {"aws-sqs-v1": {"input": {"TARGET_QUEUE_NAME": "pn_test_q"}}}}

Feedback & Support

Need help? Contact PubNub Support.

Talk to an expert

Contact Sales