This project illustrates how you can interact with RabbitMQ/ActiveMQ using MicroProfile Reactive Messaging. The complete instructions are available on https://quarkus.io/guides/rabbitmq.
In a first terminal, run:
./mvnw quarkus:add-extension -Dextensions='rest-client-reactive-jackson'
./mvnw quarkus:add-extension -Dextensions='smallrye-jwt,smallrye-jwt-build'
./mvnw quarkus:add-extension -Dextensions='hibernate-validator'> mvn -f rabbitmq-quickstart-producer quarkus:devIn a second terminal, run:
> mvn -f rabbitmq-quickstart-processor quarkus:devThen, open your browser to http://localhost:8080/quotes.html, and click on the "Request Quote" button.
To build the applications, run:
> mvn -f rabbitmq-quickstart-producer package
> mvn -f rabbitmq-quickstart-processor packageBecause we are running in prod mode, we need to provide an RabbitMQ broker. The docker-compose.yml file starts the broker and your application.
Start the broker and the applications using:
> docker compose up --buildThen, open your browser to http://localhost:8080/quotes.html, and click on the "Request Quote" button.
To build the applications into native executables, run:
> mvn -f rabbitmq-quickstart-producer package -Pnative -Dquarkus.native.container-build=true
> mvn -f rabbitmq-quickstart-processor package -Pnative -Dquarkus.native.container-build=trueThe -Dquarkus.native.container-build=true instructs Quarkus to build Linux 64bits native executables, who can run inside containers.
Then, start the system using:
> export QUARKUS_MODE=native
> docker compose upThen, open your browser to http://localhost:8080/quotes.html, and click on the "Request Quote" button.