Streaming export of messaging data - Amazon Chime

Streaming export of messaging data

You can configure your AWS Chime Messaging SDK AppInstance to receive data—messages, channel events, etc.—in the form of a stream. Currently, Amazon Chime only accepts Kinesis streams as stream destinations. Here are the following prerequisites for using your Kinesis streams with this feature:

  • A stream must be in the same region as the AppInstance.

  • Stream names have a prefix that starts with “chime-messaging-”.

  • You must configure at least two shards. Each shard can receive data up to 1MB per second, so scale your stream accordingly.

  • You must enable server-side encryption (SSE).

To configure a Kinesis stream

  1. Create one or more Kinesis streams using the prerequisites in the previous section.

  2. Call the PutAppInstanceStreamingConfigurations API.

    You can configure two app instance data types. You can configure one or both types, and you can choose the same stream or separate streams for them. The data types have the following scopes:

    Event types generated

    AppInstanceDataType

    CREATE_CHANNEL_MESSAGE

    Channel message

    REDACT_CHANNEL_MESSAGE

    UPDATE_CHANNEL_MESSAGE

    DELETE_CHANNEL_MESSAGE

    CREATE_CHANNEL

    Channel

    UPDATE_CHANNEL

    DELETE_CHANNEL

    CREATE_CHANNEL_MEMBERSHIP

    DELETE_CHANNEL_MEMBERSHIP

    CREATE_CHANNEL_BAN

    DELETE_CHANNEL_BAN

    CREATE_CHANNEL_MODERATOR

    DELETE_CHANNEL_MODERATOR

  3. Start reading the data from your configured Kinesis stream. Remember, events that occur before the configuration in Step 2 will not be retroactively streamed.

Data format

Kinesis outputs records in JSON format with the following fields: EventType and Payload. The payload format depends on the EventType. The following table lists the event types and their corresponding payload formats.

EventType

Payload format

CREATE_CHANNEL_MESSAGE

Channel message

REDACT_CHANNEL_MESSAGE

UPDATE_CHANNEL_MESSAGE

DELETE_CHANNEL_MESSAGE

CREATE_CHANNEL

Channel

UPDATE_CHANNEL

DELETE_CHANNEL

CREATE_CHANNEL_MEMBERSHIP

ChannelMembership

DELETE_CHANNEL_MEMBERSHIP

CREATE_CHANNEL_BAN

ChannelBan

DELETE_CHANNEL_BAN

CREATE_CHANNEL_MODERATOR

ChannelModerator

DELETE_CHANNEL_MODERATOR