{cq-description}
This example shows how to connect ActiveMQ Broker to Elasticsearch service, create index and send data to it.
Tip
|
Check the Camel Quarkus User guide for prerequisites and other general information. |
In order to send a message from Artemis Broker to Elasticsearch you need to start two services:
1) ActiveMQ Artemis - message broker that is connected to a paho client.
2) Elasticsearch - database that stores your data.
You can also use podman instead of docker for all the steps below.
docker run -d --rm -e AMQ_EXTRA_ARGS="--relax-jolokia" -e AMQ_USER=admin -e AMQ_PASSWORD=admin -p 61616:61616 -p 8161:8161 -p 1883:1883 --name artemis quay.io/artemiscloud/activemq-artemis-broker:1.0.26
Now you can access Artemis on localhost:8161
Once you are done with developing you may want to package and run the application.
Tip
|
Find more details about the JVM mode and Native mode in the Package and run section of Camel Quarkus User guide |
Important
|
Native mode requires having GraalVM and other tools installed. Please check the Prerequisites section of Camel Quarkus User guide. |
To prepare a native executable using GraalVM, run the following command:
mvn clean package -Pnative
./target/*-runner
curl -d 'my cool device' -H 'Content-Type: text/plain' localhost:8080/devices
Note
|
You may need to wait a few seconds for the data to be persisted before it can be retrieved. |
Please report bugs and propose improvements via GitHub issues of Camel Quarkus project.