This application demonstrates an event-driven architecture that bridges AWS EventBridge with Apache Kafka. The flow works as follows:
- External services publish events to AWS EventBridge
- EventBridge rules route events to an SQS queue based on event type
- This application polls the SQS queue for messages
- Events are processed and published to corresponding Kafka topics:
place-order-event→place-ordertopiccancel-order-event→cancel-ordertopic
- Docker and Docker Compose
- Java 17 or higher
- Gradle (included via wrapper)
The project uses Specmatic to run contract tests against the AsyncAPI specification.
./gradlew clean testThis runs contract tests defined in src/test/kotlin/ContractTest.kt which:
- Starts LocalStack (EventBridge/SQS) and Kafka using docker-compose
- Launches the application
- Runs Specmatic to validate the application against
spec/order-events-async-api.yaml
./gradlew buildStart LocalStack, Kafka, and Zookeeper:
docker compose up -d./gradlew run./scripts/send-test-events.shView messages using Kafka UI at http://localhost:8080
docker compose down -v