SNS
Confused about "SNS"?
Let us know how we can improve our documentation:
Stream can send payloads of all events from your application to an Amazon SNS topic you own.
A chat application with a lot of users generates a lots of events. With a standard Webhook configuration, events are posted to your server and can overwhelm unprepared servers during high-use periods. While the server is out, it will not be able to receive Webhooks and will fail to process them. One way to avoid this issue is to use Stream Chat's support for sending webhooks to Amazon SNS.
SNS removes the chance of losing data for Chat events by providing a large, scalable message exchange that delivers events generated by Steam Chat to as many consumers as you like.
The complete list of supported events is identical to those sent through webhooks and can be found on the Events page.
Configuration
Copied!Confused about "Configuration"?
Let us know how we can improve our documentation:
You can configure your SNS topic through the Stream Dashboard or using the Dashboard or programmatically using the REST API or an SDK with Server Side Authorization.
There are 2 ways to configure authentication on your SNS topic:
By providing a key and secret
Or by having Stream's AWS account assume a role on your SNS topic. With this option you omit the key and secret, but instead you set up a resource-based policy to grant Stream Publish permission on your SNS topic. The following policy needs to be attached to your topic (replace the value of Resource with the fully qualified ARN of your topic):
Configuring SNS through the Dashboard
Copied!Confused about "Configuring SNS through the Dashboard"?
Let us know how we can improve our documentation:
Open the Dashboard.
Select the App you want to configure from the App dropdown.
Open the Chat dropdown and select Overview.
Scroll down to the Amazon SNS section and enter the following information.
SNS Topic ARN
AWS Key (optional)
AWS Secret (optional)
At this point, you can click Test SNS to have Stream's servers test their connection with SNS and report back.
Configure Programmatically
Copied!Confused about "Configure Programmatically"?
Let us know how we can improve our documentation:
To configure an SNS topic, use a server-side SDK to set the sns_topic_arn
, sns_key
& sns_secret
app settings.
SNS Best practices and Assumptions
Copied!Confused about "SNS Best practices and Assumptions"?
Let us know how we can improve our documentation:
Set the maximum message size set to 256 KB.
Messages bigger than the maximum message size will be dropped.