This is a demo of using Apache Camel to consume messages from an AMQP (e.g. ActiveMQ Artemis) address, using Quarkus as the runtime. This demo accompanies my blog post on event-driven integration with KEDA.
curl -o apache-artemis-2.31.2-bin.tar.gz ~/Downloads/ https://dlcdn.apache.org/activemq/activemq-artemis/2.31.2/apache-artemis-2.31.2-bin.tar.gz
cd ~/Downloads/
tar -xvzf apache-artemis-2.31.2-bin.tar.gz
cd ~/Downloads/apache-artemis-2.31.2
bin/artemis create myartemis --user admin --password admin --queues queueDemo --require-login
./myartemis/bin/artemis run
You can run the application in dev mode that enables live coding using:
cd camel-amqp-quarkus
mvn quarkus:dev
Produces the camel-amqp-quarkus-1.0.0-SNAPSHOT-runner.jar
file in the /target
directory.
cd camel-amqp-quarkus
mvn package
With GraalVM istalled
sdk install java 17.0.9-graal
sdk use java 17.0.9-graal
cd camel-amqp-quarkus
mvn package -Pnative
without GraalVM installed
cd camel-amqp-quarkus
mvn package -Pnative -Dquarkus.native.container-build=true
cd camel-amqp-quarkus
docker build -f camel-amqp-quarkus/src/main/docker/Dockerfile.native -t andriykalashnykov/camel-amqp-quarkus .
docker push andriykalashnykov/camel-amqp-quarkus
cd camel-amqp-quarkus
java -jar target/camel-amqp-quarkus-1.0.0-SNAPSHOT-runner.jar
helm repo add kedacore https://kedacore.github.io/charts
helm repo update
kubectl create namespace keda
helm install keda kedacore/keda --namespace keda
Optional: load images into minikube
or KinD
docker pull andriykalashnykov/camel-amqp-quarkus
minikube image load andriykalashnykov/camel-amqp-quarkus
kubectl create namespace keda-demo
kubectl apply -f k8s/artemis.yaml
kubectl apply -f k8s/camel-amqp-quarkus.yaml
kubectl apply -f k8s/keda-scaled-camel-amqp-quarkus.yaml
kubectl exec --stdin --tty -n keda-demo artemis-85b99f8fc9-6gb4g -- /bin/sh
./var/lib/artemis/bin/artemis producer --user artemis --password artemis --destination demoqueue --message-size 1024 --message-count 10