Skip to content

Latest commit

 

History

History

pulsar-quickstart

Quarkus Pulsar Quickstart

This project illustrates how you can interact with Apache Pulsar using MicroProfile Reactive Messaging. The complete instructions are available on https://quarkus.io/guides/pulsar-quickstart.

Start the application in dev mode

In a first terminal, run:

> mvn -f pulsar-quickstart-producer quarkus:dev

In a second terminal, run:

> mvn -f pulsar-quickstart-processor quarkus:dev

Then, open your browser to http://localhost:8080/quotes.html, and click on the "Request Quote" button.

Build the application in JVM mode

To build the applications, run:

> mvn -f pulsar-quickstart-producer package
> mvn -f pulsar-quickstart-processor package

Because we are running in prod mode, we need to provide an pulsar broker. The docker-compose.yml file starts the broker and your application.

Start the broker and the applications using:

> docker compose up --build

Then, open your browser to http://localhost:8080/quotes.html, and click on the "Request Quote" button.

Build the application in native mode

To build the applications into native executables, run:

> mvn -f pulsar-quickstart-producer package -Pnative  -Dquarkus.native.container-build=true
> mvn -f pulsar-quickstart-processor package -Pnative -Dquarkus.native.container-build=true

The -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 up

Then, open your browser to http://localhost:8080/quotes.html, and click on the "Request Quote" button.