This blueprint deploys a KDA app that reads from MSK Serverless using IAM auth and writes to MSK Serverless using the Java DataStream API.
- Flink version:
1.15.2
- Java version:
11
- Scala version:
2.12
KafkaSource
connector (FlinkKafkaSource
is slated to be deprecated).KafkaSink
connector
- Build app and copy resulting JAR to S3 location
- Deploy associated infra (MSK and KDA) using CDK script
- If using existing resources, you can simply update app properties in KDA.
- Perform data generation
- Maven
- AWS SDK v2
- AWS CDK v2 - for deploying associated infra (MSK and KDA app)
-
If you haven't run
cdk bootstrap
please do so first. This is necesary on a region basis. -
First, let's set up some environment variables to make the deployment easier. Replace these values with your own S3 bucket, app name, etc.
export AWS_PROFILE=<<profile-name>>
export APP_NAME=<<name-of-your-app>>
export S3_BUCKET=<<your-s3-bucket-name>>
export S3_FILE_KEY=<<your-jar-name-on-s3>>
- Build Java Flink application locally.
From root directory of this project, run:
mvn clean compile package
- Copy jar to S3 so it can be referenced in CDK deployment
aws s3 cp target/<<your generated jar>> ${S3_BUCKET}/{S3_FILE_KEY}
-
Follow instructions in the
cdk
page to deploy the infrastructure associated with this app - such as MSK Serverless and the Kinesis Data Analytics application. -
Follow instructions in orders-datagen to generate data into MSK.
-
Start your Kinesis Data Analytics application from the AWS console.
-
Do a Flink query against the Destination Kafka Topic to validate data has landed in the destination topic.