Contact Us 1-800-596-4880

Amazon Kinesis Data Streams Connector 1.0 Examples

The following example shows how to use Anypoint Connector for Amazon Kinesis Data Streams (Amazon Kinesis Data Streams Connector) to put data records and listen from an Amazon Kinesis data stream.

Amazon Kinesis Data Streams Connector supports Enhanced Fan-Out (EFO)Leaving the Site by default. This means that the connector automatically subscribes to all shards of the configured stream using EFO.

The connector’s behavior aligns with AWS Kinesis Client Library (KCL) version 2.0 and later. The connector uses the same implementation as shown in Develop enhanced fan-out consumers using KCL 2.x in JavaLeaving the Site.

Before you try the example, access Anypoint Studio (Studio) and verify that the Mule Palette view displays entries for Kinesis. If not, follow the instructions in Add the Connector to Your Project.

Flows for This Example

The following screenshots show the Anypoint Studio app flows for this example:

  • This flow uses the Put Records operation to put data into the Amazon Kinesis data stream. In this flow, HTTP > Listener receives a query parameter named data that sets the payload for the Put Record operation. It uses a query parameter named partitionKey to set the partition key value for the Put Record operation.

    Put Record operation flow
  • This flow uses the Listener source to listen for new data records:

    Listener source flow
  • This flow uses the Listener source to listen for new data records. After receiving the new records, it calls the Checkpoint operation to set a manual checkpoint:

    Checkpoint operation flow

XML Code for This Example

View on GitHub