Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/julian-eggers/spring-rabbitmq-dead-letter-queue-example
Spring RabbitMQ Dead Letter Queue (DLQ) Example
https://github.com/julian-eggers/spring-rabbitmq-dead-letter-queue-example
dead-letter-queue dlq java rabbitmq spring spring-boot
Last synced: about 2 months ago
JSON representation
Spring RabbitMQ Dead Letter Queue (DLQ) Example
- Host: GitHub
- URL: https://github.com/julian-eggers/spring-rabbitmq-dead-letter-queue-example
- Owner: julian-eggers
- License: mit
- Created: 2017-01-03T22:45:06.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-12T10:58:22.000Z (almost 6 years ago)
- Last Synced: 2024-10-10T05:37:11.273Z (2 months ago)
- Topics: dead-letter-queue, dlq, java, rabbitmq, spring, spring-boot
- Language: Java
- Homepage:
- Size: 20.5 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
RabbitMQ Dead Letter Queue Example with Spring
==============================================## Concept
- Every queue has its dead letter queue
- Dead letter messages are routed directly to the dead letter queue, not via bindings
- Dead letter queues are [lazy](https://www.rabbitmq.com/lazy-queues.html) to save resourcesThis is different to the [rabbitmq-concept](https://www.rabbitmq.com/dlx.html) which recommends to use a separate exchange to route the dead letter messages.
## Queue Properties
### Queue
- x-dead-letter-exchange=
- x-dead-letter-routing-key=DLQ-Name### Dead letter queue
- x-queue-mode=lazy## Docker Example
Run the following command to start a container which creates example-queues and sends messages to them.
It tries to connect to a rabbitmq-server on localhost with username "guest" and password "guest".```
docker run \
-d \
--name=spring-rabbitmq-dead-letter-queue-example \
-p 8080:8080 \
jeggers/spring-rabbitmq-dead-letter-queue-example:latest \
--spring.rabbitmq.addresses=localhost \
--spring.rabbitmq.username=guest \
--spring.rabbitmq.password=guest
```### Endpoints to check the result
- http://localhost:8080/actuator/prometheus
- http://localhost:8080/actuator/health## Build & Release
### Build
```
mvn clean package dockerfile:build
```### Release
```
mvn clean package dockerfile:build dockerfile:tag@tag-latest dockerfile:tag@tag-version dockerfile:push@push-latest dockerfile:push@push-version github-release:release
```