A POC of Event Driven Architecture using Amazon EventBridge and Amazon MQ for RabbitMQ as pub/sub technology candidates.
This POC aims to achieve a goal that event producers are not aware of event consumers. It demonstrate the distributed channels implementation of EDA, where the services are autonomous and do not share common infrastructure.
There are two components/services in this POC, the publisher(pub) and the subscriber(sub), separated by folders. The pub deploys an EventBridge Event Bus and an RabbitMQ broker plus a direct exchange as its channels. The sub deploys an EventBridge rule refers to the EventBridge Event Bus and a queue plus a binding to the exchange to listen and filter events. Both subscriptions are handled by a Lambda function for simplicity.
Feature | Amazon EventBridge | Amazon MQ for RabbitMQ |
---|---|---|
Producer not aware of consumer | ✔️ | ✔️ Although Terraform can help to decouple the infrastructure code, the queues and bindings are still physically reside in the broker. |
Event filtering | ✔️ | Limited by routing key. |
Event replay | ✔️ | Self-implement |
Event monitoring | CloudWatch. Most metrics are for sub. | CloudWatch. Most metrics are broker/node metrics. Could be configured to write logs to CloudWatch. RabbitMQ console. |
Event reliability | Retries and dead letter queue | Dead letter exchange |
Pricing | Pay-per-use | Managed instance |