This project illustrates how you can use Artemis JMS with Quarkus.
First you need an Artemis server. You can follow the instructions from the Apache Artemis web site or run via docker:
docker run -it --rm -p 8161:8161 -p 61616:61616 -e ARTEMIS_USERNAME=quarkus -e ARTEMIS_PASSWORD=quarkus vromero/activemq-artemis:2.9.0-alpine
The application can be started using:
mvn quarkus:dev
Then, open your browser to http://localhost:8080/prices.html
, and you should see a button to fetch the last price.
In addition to the prices.html
page, the application is composed by 3 components:
PriceProducer
- thePriceProducer
sends random prices to a JMS queue.PriceConsumer
- thePriceConsumer
receives the JMS message and stores the last price.PriceResource
- thePriceResource
is able to sent the last price of the PriceConsumer back to the browser.
The configuration is located in the application configuration.
You can compile the application into a native binary using:
mvn clean package -Pnative
and run with:
./target/jms-quickstart-1.0-SNAPSHOT-runner