Code for RabbitMQ Streams Blog Posts.
- JDK 8 or more
- Local instance of RabbitMQ 3.9+ with stream plugin enabled.
To start RabbitMQ:
docker run -it --rm --name rabbitmq -p 5552:5552 \
-e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS='-rabbitmq_stream advertised_host localhost' \
rabbitmq:3.9
In another terminal tab, enable the stream plugin:
docker exec rabbitmq rabbitmq-plugins enable rabbitmq_stream
Publishing:
./mvnw -q compile exec:java -Dexec.mainClass='com.rabbitmq.stream.FirstApplication$Publish'
Consuming:
./mvnw -q compile exec:java -Dexec.mainClass='com.rabbitmq.stream.FirstApplication$Consume'
NB: remove the -q
option if nothing is output on the console, this will help to diagnose problems.
NB: remove the -q
option if nothing is output on the console, this will help to diagnose problems.
NB: remove the -q
option if nothing is output on the console, this will help to diagnose problems.