This is an automated email from the ASF dual-hosted git repository. JiriOndrusek pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-quarkus-examples.git
commit e8ee0b51922ee3270858506d69ee948e05da7203 Author: James Netherton <[email protected]> AuthorDate: Fri Aug 7 07:11:29 2026 +0100 Improve README quality and consistency - Standardized ActiveMQ Artemis versions to artemis.2.52.0 across all examples - Improved some grammar and wording for better clarity - Removed shell prompt $ prefixes from command examples for better copy-paste UX - Fixed typo in saga diagram filename (compesate -> compensate) - Added native mode explanation for spring-redis example --- amqp/README.adoc | 4 +- artemis-elasticsearch/README.adoc | 4 +- .../org/acme/resource/CustomPahoTestResource.java | 2 +- aws-lambda/README.adoc | 12 +-- aws2-s3/README.adoc | 10 +-- cluster-leader-election/README.adoc | 13 ++-- cxf-soap/README.adoc | 28 +++---- cyberark-vault/README.adoc | 18 ++--- data-extract-langchain4j/README.adoc | 4 +- fhir/README.adoc | 40 +++++----- file-bindy-ftp/README.adoc | 22 +++--- file-split-log-xml/README.adoc | 10 +-- health/README.adoc | 10 +-- http-log/README.adoc | 10 +-- http-pqc-j17/README.adoc | 16 ++-- http-pqc-j21/README.adoc | 26 +++---- jms-jpa/README.adoc | 12 +-- jpa-idempotent-repository/README.adoc | 2 +- jta-jpa/README.adoc | 10 +-- kafka/README.adoc | 42 +++++------ kamelet-chucknorris/README.adoc | 10 +-- message-bridge/README.adoc | 11 +-- message-bridge/src/main/resources/resources.yml | 2 +- netty-custom-correlation/README.adoc | 10 +-- observability/README.adoc | 36 ++++----- openapi-contract-first/README.adoc | 10 +-- platform-http-security-keycloak/README.adoc | 59 ++++++++------- quarkus-rest-json/README.adoc | 28 +++---- rest-json/README.adoc | 10 +-- rest-keycloak-soap-jms/README.adoc | 82 ++++++++++----------- saga/README.adoc | 12 +-- ...ompesate-diagram.png => compensate-diagram.png} | Bin .../camel/example/saga/SagaTestResource.java | 2 +- spring-redis/README.adoc | 8 +- timer-log-main/README.adoc | 10 +-- timer-log/README.adoc | 10 +-- variables/README.adoc | 10 +-- vertx-websocket-chat/README.adoc | 10 +-- 38 files changed, 308 insertions(+), 307 deletions(-) diff --git a/amqp/README.adoc b/amqp/README.adoc index 5af2ab52..813b1fea 100644 --- a/amqp/README.adoc +++ b/amqp/README.adoc @@ -10,14 +10,14 @@ and other general information. == Prerequisites: -In order to send or receive messages to / from the Artemis Broker, you need to start a service. +To send or receive messages to/from the Artemis Broker, you need to start a service. You can either run Artemis in a container or from a downloaded Artemis binary distribution. === Run the Artemis container: [source,shell] ---- -docker run -d --rm -e AMQ_EXTRA_ARGS="--relax-jolokia" -e AMQ_USER=admin -e AMQ_PASSWORD=admin -p 5672:5672 -p 8161:8161 --name artemis quay.io/arkmq-org/activemq-artemis-broker:artemis.2.51.0 +docker run -d --rm -e AMQ_EXTRA_ARGS="--relax-jolokia" -e AMQ_USER=admin -e AMQ_PASSWORD=admin -p 5672:5672 -p 8161:8161 --name artemis quay.io/arkmq-org/activemq-artemis-broker:artemis.2.52.0 ---- Now you can access Artemis on localhost:8161. diff --git a/artemis-elasticsearch/README.adoc b/artemis-elasticsearch/README.adoc index 0108e6a1..7055fb4f 100644 --- a/artemis-elasticsearch/README.adoc +++ b/artemis-elasticsearch/README.adoc @@ -10,7 +10,7 @@ and other general information. == Prerequisites: -In order to send a message from Artemis Broker to Elasticsearch you need to start two services: +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. @@ -24,7 +24,7 @@ You can also use podman instead of docker for all the steps below. [source,shell] ---- -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/arkmq-org/activemq-artemis-broker:artemis.2.51.0 +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/arkmq-org/activemq-artemis-broker:artemis.2.52.0 ---- Now you can access Artemis on localhost:8161 diff --git a/artemis-elasticsearch/src/test/java/org/acme/resource/CustomPahoTestResource.java b/artemis-elasticsearch/src/test/java/org/acme/resource/CustomPahoTestResource.java index ff02309f..d9306534 100644 --- a/artemis-elasticsearch/src/test/java/org/acme/resource/CustomPahoTestResource.java +++ b/artemis-elasticsearch/src/test/java/org/acme/resource/CustomPahoTestResource.java @@ -32,7 +32,7 @@ public class CustomPahoTestResource implements QuarkusTestResourceLifecycleManag @Override public Map<String, String> start() { - String imageName = "quay.io/arkmq-org/activemq-artemis-broker:artemis.2.51.0"; + String imageName = "quay.io/arkmq-org/activemq-artemis-broker:artemis.2.52.0"; if ("ppc64le".equals(SystemUtils.OS_ARCH)) { imageName = "icr.io/ppc64le-oss/activemq-artemis-broker-ppc64le:2.0.2"; } diff --git a/aws-lambda/README.adoc b/aws-lambda/README.adoc index f7e09e7a..e4163d2c 100644 --- a/aws-lambda/README.adoc +++ b/aws-lambda/README.adoc @@ -13,7 +13,7 @@ with mock events, refer to the https://quarkus.io/guides/amazon-lambda#live-codi [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -33,8 +33,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -DskipTests -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package -DskipTests +java -jar target/quarkus-app/quarkus-run.jar ---- ==== Native mode @@ -46,8 +46,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -DskipTests -Dnative -$ ./target/*-runner +mvn clean package -DskipTests -Dnative +./target/*-runner ---- === Extra Build Generated Files @@ -92,7 +92,7 @@ https://quarkus.io/guides/amazon-lambda#extra-build-generated-files[Please click 9. Under the Code tab scroll down to the Runtime settings and click edit -10. For the Handler details please provide the Quarkus Handler +10. For the Handler, enter the Quarkus handler: [source,shell] ---- diff --git a/aws2-s3/README.adoc b/aws2-s3/README.adoc index c8664e1f..89040931 100644 --- a/aws2-s3/README.adoc +++ b/aws2-s3/README.adoc @@ -31,7 +31,7 @@ export AWS_BUCKET_NAME=<your-bucket-name> [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -67,8 +67,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. ---- @@ -82,8 +82,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.013s. ... diff --git a/cluster-leader-election/README.adoc b/cluster-leader-election/README.adoc index 0dd38d66..0dbf03c0 100644 --- a/cluster-leader-election/README.adoc +++ b/cluster-leader-election/README.adoc @@ -3,9 +3,10 @@ {cq-description} -Suppose an application connects out to an external service and receives information asynchronously via a TCP socket or websocket. As part of this process, the application receives data, transforms the structure, and publishes that data into an https://developers.redhat.com/topics/kafka-kubernetes[Apache Kafka] topic. In this case, only a single connection can be active at one time because of the possibility of publishing duplicate data (see diagram below). +Suppose an application connects to an external service and receives information asynchronously via a TCP socket or websocket. As part of this process, the application receives data, transforms the structure, a +nd publishes that data into an https://developers.redhat.com/topics/kafka-kubernetes[Apache Kafka] topic. In this case, only a single connection can be active at one time because of the possibility of publishing duplicate data (see diagram below). -image::figure1.png[] +image::figure1.png[Diagram showing leader election pattern preventing duplicate data publication to Kafka] The quick solution to this problem is actually a fundamental characteristic of Kubernetes. If the deployment is created with the replicas set to 1, then when the controller detects the pod is no longer running, it will attempt to create a new one. However, real-world situations can be more complicated. Some applications require a long startup time due to cache warming needs. When you combine slow startup times (minutes) for the pod with business requirements to minimize the loss of downt [...] @@ -23,7 +24,7 @@ Within the component's configuration, the developer provides a namespace to desi [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -44,7 +45,7 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package +mvn clean package ---- === Native mode @@ -56,7 +57,7 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative +mvn clean package -Dnative ---- == Local Playground @@ -72,7 +73,7 @@ Run the packaged application in separate terminals. JVM Mode: [source,shell] ---- -$ java -jar target/quarkus-app/quarkus-run.jar +java -jar target/quarkus-app/quarkus-run.jar ---- In case you built the application in Native mode: diff --git a/cxf-soap/README.adoc b/cxf-soap/README.adoc index e972b324..9a12a2ae 100644 --- a/cxf-soap/README.adoc +++ b/cxf-soap/README.adoc @@ -56,7 +56,7 @@ For purpose of easier testing this approach we also added Camel Quarkus REST end [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -81,7 +81,7 @@ Then verify it was added with: [source,shell] ---- -$ curl -X POST -H "Content-Type: text/xml;charset=UTF-8" -d @src/main/resources/requests/contact/getAll.xml http://localhost:8080/cxf/services/contact +curl -X POST -H "Content-Type: text/xml;charset=UTF-8" -d @src/main/resources/requests/contact/getAll.xml http://localhost:8080/cxf/services/contact ---- Which should return: @@ -111,10 +111,10 @@ We can also test our customer service: [source,shell] ---- -$ curl -X POST -H "Content-Type: text/xml;charset=UTF-8" -d @src/main/resources/requests/customer/getByName.xml http://localhost:8080/cxf/services/customer +curl -X POST -H "Content-Type: text/xml;charset=UTF-8" -d @src/main/resources/requests/customer/getByName.xml http://localhost:8080/cxf/services/customer ---- -You can observe that we have hardcoded `test` as the name in the `SOAPBody` part in `src/main/resources/requests/customer/getByName.xml` as follows: +Note that `test` is hardcoded as the name in the `SOAPBody` part in `src/main/resources/requests/customer/getByName.xml` as follows: [source, xml] ---- @@ -166,8 +166,8 @@ To discover WSDLs of our services, you can use: [source, shell] ---- -$ curl "http://localhost:8080/cxf/services/contact?wsdl" -$ curl "http://localhost:8080/cxf/services/customer?wsdl" +curl "http://localhost:8080/cxf/services/contact?wsdl" +curl "http://localhost:8080/cxf/services/customer?wsdl" ---- === Interacting via Camel Quarkus CXF producer @@ -177,12 +177,12 @@ For testing purpose, we've also exposed REST endpoints to easily approach it ext Firstly we will add new contact with: [source, shell] ---- -$ curl -X POST -H "Content-Type: application/json" --data '{"name":"Lukas","address":{"city":"Czech Republic","street":"Random Street"},"type":"OTHER"}' "http://localhost:8080/producer/contact?operationName=addContact" +curl -X POST -H "Content-Type: application/json" --data '{"name":"Lukas","address":{"city":"Czech Republic","street":"Random Street"},"type":"OTHER"}' "http://localhost:8080/producer/contact?operationName=addContact" ---- Then we will request all contacts with: [source, shell] ---- -$ curl -X GET "http://localhost:8080/producer/contacts?operationName=getContacts" +curl -X GET "http://localhost:8080/producer/contacts?operationName=getContacts" ---- Which should return something like: @@ -213,8 +213,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ---- === Native mode @@ -226,8 +226,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ---- == Kubernetes @@ -236,7 +236,7 @@ $ ./target/*-runner [source,shell] ---- -$ mvn clean package -DskipTests -Dquarkus.kubernetes.deploy=true -Dkubernetes +mvn clean package -DskipTests -Dquarkus.kubernetes.deploy=true -Dkubernetes ---- You should see one pod running: @@ -250,7 +250,7 @@ Then use following command to redirect the localhost network to the Kubernetes n [source,shell] ---- -$ kubectl port-forward service/camel-quarkus-examples-cxf-soap 8080:8080 +kubectl port-forward service/camel-quarkus-examples-cxf-soap 8080:8080 ---- Open another terminal and then follow instructions from <<playground>>. diff --git a/cyberark-vault/README.adoc b/cyberark-vault/README.adoc index 00862d5f..8692f8de 100644 --- a/cyberark-vault/README.adoc +++ b/cyberark-vault/README.adoc @@ -17,7 +17,7 @@ environment via Docker Compose: [source,shell] ---- -$ ./start-conjur.sh +./start-conjur.sh ---- The script starts the containers, initializes the account, loads the security policy and prints the @@ -39,7 +39,7 @@ To stop the Docker-based Conjur environment: [source,shell] ---- -$ ./start-conjur.sh stop +./start-conjur.sh stop ---- == Start in the Development mode @@ -48,7 +48,7 @@ With the environment variables set, start the example in dev mode: [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- Then look at the log output in the console. There is a timer route that periodically resolves the secret @@ -57,7 +57,7 @@ To store a secret, open a new terminal and run: [source,shell] ---- -$ curl -X POST http://localhost:8080/cyberark-vault/createSecret -d 'my-secret-value' +curl -X POST http://localhost:8080/cyberark-vault/createSecret -d 'my-secret-value' ---- Following messages will show the resolved secret value. As we run the example in Quarkus Dev Mode, you can @@ -78,8 +78,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. ---- @@ -93,8 +93,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.013s. ... @@ -106,7 +106,7 @@ By default, the tests use testcontainers to start a local Conjur environment aut [source,shell] ---- -$ mvn clean verify +mvn clean verify ---- To run the tests against an external Conjur instance instead, set the environment variables described diff --git a/data-extract-langchain4j/README.adoc b/data-extract-langchain4j/README.adoc index c1dfbe6d..c04ca193 100644 --- a/data-extract-langchain4j/README.adoc +++ b/data-extract-langchain4j/README.adoc @@ -6,13 +6,13 @@ TIP: Check the https://camel.apache.org/camel-quarkus/latest/first-steps.html[Camel Quarkus User guide] for prerequisites and other general information. -Suppose the volume of https://en.wikipedia.org/wiki/Unstructured_data[unstructured data] grows at a high pace in a given organization. +Suppose the volume of https://en.wikipedia.org/wiki/Unstructured_data[unstructured data] is growing rapidly in a given organization. How could one transform those disseminated gold particles into a conform bullion that could be used in banks. For instance, let's imagine an insurance company that would record the transcripts of the conversation when customers are discussing with the hotline. There is probably a lot of valuable information that could be extracted from those conversation transcripts. In this example, we'll convert those text conversations into Java Objects that could then be used in the rest of the Camel route. -image::schema.png[] +image::schema.png[Architecture diagram showing unstructured text data being processed through LLM to extract structured Java objects] In order to achieve this extraction, we'll need a https://en.wikipedia.org/wiki/Large_language_model[Large Language Model (LLM)] and related serving framework that natively supports https://ollama.com/blog/structured-outputs[JSON structured output]. Here, we choose https://ollama.com/library/granite4.1:3b[granite4.1:3b] served through https://ollama.com/[ollama]. diff --git a/fhir/README.adoc b/fhir/README.adoc index ac5ae632..e44bad8f 100644 --- a/fhir/README.adoc +++ b/fhir/README.adoc @@ -28,7 +28,7 @@ Ensure that the aforementioned FHIR server container is started and run. [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -41,14 +41,14 @@ To interact with the application, first capture the local host / port of the run [source,shell] ---- -$ APPLICATION_HOST=localhost:8080 +APPLICATION_HOST=localhost:8080 ---- Next, upload some patient data. [source,shell] ---- -$ curl -X POST -H 'Content-Type: application/json' --data-binary @src/test/resources/data/hl7v2.patient "http://${APPLICATION_HOST}/api/patients" +curl -X POST -H 'Content-Type: application/json' --data-binary @src/test/resources/data/hl7v2.patient "http://${APPLICATION_HOST}/api/patients" ---- A JSON response will be generated of the patient record. @@ -73,7 +73,7 @@ Use the `id` value to retrieve the patient record. [source,shell] ---- -$ curl "http://${APPLICATION_HOST}/api/patients/1" +curl "http://${APPLICATION_HOST}/api/patients/1" ---- === Package and run the application @@ -90,8 +90,8 @@ Ensure that the aforementioned FHIR server container is started before running t [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.885s. Listening on: http://0.0.0.0:8080 ---- @@ -105,8 +105,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.026s. Listening on: http://0.0.0.0:8080 ... @@ -118,7 +118,7 @@ You can build a container image for the application like this. Refer to the http [source,shell] ---- -$ mvn clean package -DskipTests -Dquarkus.container-image.build=true +mvn clean package -DskipTests -Dquarkus.container-image.build=true ---- If you are using a local development cluster like Kind or k3s, you can use host the container image on your local host. Or, with minikube, use the Docker daemon from the cluster virtual machine `eval $(minikube docker-env)`. Otherwise, you'll need to push the image to a registry of your choosing. @@ -127,7 +127,7 @@ Next apply the necessary resources to the cluster. [source,shell] ---- -$ kubectl apply -f target/kubernetes/kubernetes.yml +kubectl apply -f target/kubernetes/kubernetes.yml service/camel-quarkus-examples-fhir created service/fhir-server created @@ -141,7 +141,7 @@ Check that pods are running. Note that depending on available cluster resources, [source,shell] ---- -$ kubectl get pods +kubectl get pods NAME READY STATUS RESTARTS AGE camel-quarkus-examples-fhir-5d48f4d85c-sjl8k 1/1 Running 0 21s @@ -152,14 +152,14 @@ To interact with the application, set the `APPLICATION_HOST` variable to whateve [source,shell] ---- -$ APPLICATION_HOST=<application exposed host here> +APPLICATION_HOST=<application exposed host here> ---- Next, upload some patient data. [source,shell] ---- -$ curl -X POST -H 'Content-Type: application/json' --data-binary @src/test/resources/data/hl7v2.patient "http://${APPLICATION_HOST}/api/patients" +curl -X POST -H 'Content-Type: application/json' --data-binary @src/test/resources/data/hl7v2.patient "http://${APPLICATION_HOST}/api/patients" ---- A JSON response will be generated of the patient record. @@ -184,14 +184,14 @@ Use the `id` value to retrieve the patient record. [source,shell] ---- -$ curl "http://${APPLICATION_HOST}/api/patients/1" +curl "http://${APPLICATION_HOST}/api/patients/1" ---- To clean up do. [source,shell] ---- -$ kubectl delete all -l app.kubernetes.io/name=camel-quarkus-examples-fhir +kubectl delete all -l app.kubernetes.io/name=camel-quarkus-examples-fhir ---- [NOTE] @@ -205,7 +205,7 @@ To start a Source To Image (S2I) build and deploy the application. [source,shell] ---- -$ mvn clean package -DskipTests -Dquarkus.kubernetes.deploy=true -Dopenshift +mvn clean package -DskipTests -Dquarkus.kubernetes.deploy=true -Dopenshift ---- You can check the pod status and tail logs using the commands mentioned above in the Kubernetes section. Use the `oc` binary instead of `kubectl` if preferred. @@ -214,14 +214,14 @@ To interact with the application, first identify the OpenShift route URL. [source,shell] ---- -$ APPLICATION_HOST=$(oc get route camel-quarkus-examples-fhir -o jsonpath='{.spec.host}') +APPLICATION_HOST=$(oc get route camel-quarkus-examples-fhir -o jsonpath='{.spec.host}') ---- Next, upload some patient data. [source,shell] ---- -$ curl -X POST -H 'Content-Type: application/json' --data-binary @src/test/resources/data/hl7v2.patient "http://${APPLICATION_HOST}/api/patients" +curl -X POST -H 'Content-Type: application/json' --data-binary @src/test/resources/data/hl7v2.patient "http://${APPLICATION_HOST}/api/patients" ---- A JSON response will be generated of the patient record. @@ -246,7 +246,7 @@ Use the `id` value to retrieve the patient record. [source,shell] ---- -$ curl "http://${APPLICATION_HOST}/api/patients/1" +curl "http://${APPLICATION_HOST}/api/patients/1" ---- The JSON response should match the value returned on the create patient request. @@ -255,7 +255,7 @@ To clean up do. [source,shell] ---- -$ oc delete all -l app.kubernetes.io/name=camel-quarkus-examples-fhir +oc delete all -l app.kubernetes.io/name=camel-quarkus-examples-fhir ---- == Feedback diff --git a/file-bindy-ftp/README.adoc b/file-bindy-ftp/README.adoc index 543594e7..b4edff13 100644 --- a/file-bindy-ftp/README.adoc +++ b/file-bindy-ftp/README.adoc @@ -29,7 +29,7 @@ Ensure the aforementioned FTP server is running and do the following to run the [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -83,8 +83,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -DskipTests -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package -DskipTests +java -jar target/quarkus-app/quarkus-run.jar ---- ==== Native mode @@ -96,8 +96,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -DskipTests -Dnative -$ ./target/*-runner +mvn clean package -DskipTests -Dnative +./target/*-runner ---- ==== Deploying to Kubernetes @@ -106,7 +106,7 @@ You can build a container image for the application like this. Refer to the http [source,shell] ---- -$ mvn clean package -DskipTests -Dquarkus.container-image.build=true +mvn clean package -DskipTests -Dquarkus.container-image.build=true ---- If you are using a local development cluster like Kind or k3s, you can use host the container image on your local host. Or, with minikube, use the Docker daemon from the cluster virtual machine `eval $(minikube docker-env)`. Otherwise, you'll need to push the image to a registry of your choosing. @@ -115,7 +115,7 @@ Next apply the necessary resources to the cluster. [source,shell] ---- -$ kubectl apply -f target/kubernetes/kubernetes.yml +kubectl apply -f target/kubernetes/kubernetes.yml secret/ftp-credentials created service/camel-quarkus-examples-file-bindy-ftp created @@ -130,7 +130,7 @@ Check pods are running. [source,shell] ---- -$ kubectl get pods +kubectl get pods NAME READY STATUS RESTARTS AGE camel-quarkus-examples-file-bindy-ftp-5d48f4d85c-sjl8k 1/1 Running 0 21s @@ -141,14 +141,14 @@ Tail the application logs. [source,shell] ---- -$ kubectl logs -f camel-quarkus-examples-file-bindy-ftp-5d48f4d85c-sjl8k +kubectl logs -f camel-quarkus-examples-file-bindy-ftp-5d48f4d85c-sjl8k ---- To clean up do. [source,shell] ---- -$ kubectl delete all -l app.kubernetes.io/name=camel-quarkus-examples-file-bindy-ftp +kubectl delete all -l app.kubernetes.io/name=camel-quarkus-examples-file-bindy-ftp ---- [NOTE] @@ -162,7 +162,7 @@ To start a Source To Image (S2I) build and deploy the application. [source,shell] ---- -$ mvn clean package -DskipTests -Dquarkus.kubernetes.deploy=true -Dopenshift +mvn clean package -DskipTests -Dquarkus.kubernetes.deploy=true -Dopenshift ---- You can check the pod status and tail logs using the commands mentioned above in the Kubernetes section. Use the `oc` binary instead of `kubectl` if preferred. diff --git a/file-split-log-xml/README.adoc b/file-split-log-xml/README.adoc index fdb173f1..e3e5d8cc 100644 --- a/file-split-log-xml/README.adoc +++ b/file-split-log-xml/README.adoc @@ -20,7 +20,7 @@ and other general information. [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -44,8 +44,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.570s. @@ -60,8 +60,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.011s. ... diff --git a/health/README.adoc b/health/README.adoc index 2e5fabac..66e96378 100644 --- a/health/README.adoc +++ b/health/README.adoc @@ -22,7 +22,7 @@ The details can be seen at runtime via the following url from a web browser: htt [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -45,8 +45,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.885s. Listening on: http://0.0.0.0:8080 ---- @@ -60,8 +60,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.026s. Listening on: http://0.0.0.0:8080 ... diff --git a/http-log/README.adoc b/http-log/README.adoc index 66aa488a..c7de4a22 100644 --- a/http-log/README.adoc +++ b/http-log/README.adoc @@ -23,7 +23,7 @@ how to quickly run 100 Camels with Apache Camel, Quarkus and GraalVM: [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -53,8 +53,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. Listening on: http://0.0.0.0:8080 ---- @@ -68,8 +68,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.013s. Listening on: http://0.0.0.0:8080 ... diff --git a/http-pqc-j17/README.adoc b/http-pqc-j17/README.adoc index f448aa98..9f93ab4d 100644 --- a/http-pqc-j17/README.adoc +++ b/http-pqc-j17/README.adoc @@ -49,7 +49,7 @@ Generated files in `target/certs/`: [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your workspace. Any modifications in your project will automatically take effect in the running application. @@ -75,7 +75,7 @@ Test with hybrid certificate (should succeed): [source,shell] ---- -$ curl --cert target/certs/client-hybrid-keystore-cert.pem \ +curl --cert target/certs/client-hybrid-keystore-cert.pem \ --key target/certs/client-hybrid-keystore-key.pem \ -k \ https://localhost:8443/pqc/secure @@ -95,8 +95,8 @@ TIP: Find more details about the JVM mode and Native mode in the Package and run [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-http-pqc started in 1.5s. Listening on: https://0.0.0.0:8443 ---- @@ -109,8 +109,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-http-pqc started in 0.015s. Listening on: https://0.0.0.0:8443 ... @@ -122,7 +122,7 @@ Run the tests to verify hybrid certificate functionality: [source,shell] ---- -$ mvn clean test +mvn clean test ---- The test suite validates: @@ -136,7 +136,7 @@ For native mode testing: [source,shell] ---- -$ mvn clean verify -Dnative +mvn clean verify -Dnative ---- == How It Works (Java 17 Application-Level Validation) diff --git a/http-pqc-j21/README.adoc b/http-pqc-j21/README.adoc index a2c879cf..ac2dba23 100644 --- a/http-pqc-j21/README.adoc +++ b/http-pqc-j21/README.adoc @@ -47,7 +47,7 @@ NOTE: Certificates use traditional RSA signatures. The PQC protection comes from [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your workspace. Any modifications in your project will automatically take effect in the running application. @@ -89,10 +89,10 @@ Start the application with fallback configuration and test with curl: [source,shell] ---- -$ mvn quarkus:dev +mvn quarkus:dev # In another terminal -$ curl --cert target/certs/client-keystore.p12:changeit \ +curl --cert target/certs/client-keystore.p12:changeit \ --cert-type P12 \ -k \ https://localhost:xxxxx/pqc/secure @@ -116,7 +116,7 @@ To actually test X25519MLKEM768 hybrid key exchange, use a PQC-capable client. T [source,shell] ---- # Run the test that proves PQC is working -$ mvn test -Dtest=PqcOnlyTest#testHttpClientWithBCJSSE +mvn test -Dtest=PqcOnlyTest#testHttpClientWithBCJSSE ---- This test uses BouncyCastle JSSE provider which supports X25519MLKEM768, proving the server requires PQC when configured with `jdk.tls.namedGroups=X25519MLKEM768`. @@ -131,8 +131,8 @@ TIP: Find more details about the JVM mode and Native mode in the Package and run [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-http-pqc-j21 started in ?.?s. Listening on: https://0.0.0.0:xxxxx ---- @@ -145,8 +145,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-http-pqc-j21 started in ?.?s. Listening on: https://0.0.0.0:xxxxx ... @@ -158,7 +158,7 @@ Run the tests to verify PQC functionality: [source,shell] ---- -$ mvn clean test +mvn clean test ---- The test suite validates: @@ -178,20 +178,20 @@ Run individual tests: [source,shell] ---- # Test PQC enforcement -$ mvn clean test -Dtest=PqcOnlyTest +mvn clean test -Dtest=PqcOnlyTest # Test backward compatibility -$ mvn clean test -Dtest=PqcWithFallbackTest +mvn clean test -Dtest=PqcWithFallbackTest # Test specific scenario -$ mvn clean test -Dtest=PqcOnlyTest#testHttpClientWithBCJSSE +mvn clean test -Dtest=PqcOnlyTest#testHttpClientWithBCJSSE ---- For native mode testing: [source,shell] ---- -$ mvn clean verify -Dnative +mvn clean verify -Dnative ---- NOTE: Native mode only tests the fallback scenario (PqcWithFallbackIT) because a native executable can be built with only one `jdk.tls.namedGroups` configuration. Testing both scenarios would require building two separate native executables. diff --git a/jms-jpa/README.adoc b/jms-jpa/README.adoc index fe210666..7d7aaddb 100644 --- a/jms-jpa/README.adoc +++ b/jms-jpa/README.adoc @@ -18,7 +18,7 @@ NOTE: The Narayana `node.identifier` is very important when you scale up in the [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -71,7 +71,7 @@ Start Artemis: docker run --name artemis \ -e AMQ_USER=admin -e AMQ_PASSWORD=admin \ -d -p 61616:61616 \ - quay.io/artemiscloud/activemq-artemis-broker + quay.io/arkmq-org/activemq-artemis-broker:artemis.2.52.0 ---- @@ -101,8 +101,8 @@ docker run --name artemis \ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.570s. @@ -117,8 +117,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.011s. ... diff --git a/jpa-idempotent-repository/README.adoc b/jpa-idempotent-repository/README.adoc index 874e3d8b..36542b5f 100644 --- a/jpa-idempotent-repository/README.adoc +++ b/jpa-idempotent-repository/README.adoc @@ -9,7 +9,7 @@ and other general information. Suppose an application needs to invoke a costly API. Each time a duplicate message would be processed, then a bunch of money would be lost. In such situations, it could make sense to prevent some duplicate calls by using the https://camel.apache.org/components/latest/eips/idempotentConsumer-eip.html[idempotent consumer] EIP. Let's see an example with the schema below: -image::schema.png[] +image::schema.png[Architecture diagram showing idempotent consumer pattern using JPA repository to prevent duplicate message processing] As one could see in the schema, using the idempotent consumer pattern in Camel is as simple as creating a route using the `idempotentConsumer` and `idempotentRepository` keywords. In this example, the idempotent repository is a database that is edited and read through JPA. Under the hood, this database will keep track of messages that have already been processed. diff --git a/jta-jpa/README.adoc b/jta-jpa/README.adoc index eca7f18c..95f3694a 100644 --- a/jta-jpa/README.adoc +++ b/jta-jpa/README.adoc @@ -18,7 +18,7 @@ NOTE: The Narayana `node.identifier` is very important when you scale up in the [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -86,8 +86,8 @@ docker exec -it db-mysql mysql -uadmin -padmin testdb -e \ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.570s. @@ -102,8 +102,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.011s. ... diff --git a/kafka/README.adoc b/kafka/README.adoc index 68b03ff4..db136fd7 100644 --- a/kafka/README.adoc +++ b/kafka/README.adoc @@ -25,7 +25,7 @@ TIP: If you want to use another running instance, in dev mode. Uncomment the cor [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -53,7 +53,7 @@ Next a Kafka consumer reads the messages and put them in a seda queue. Next pull a message from the queue : [source,shell] ---- -$ curl -X GET http://0.0.0.0:8080/example +curl -X GET http://0.0.0.0:8080/example ---- @@ -77,37 +77,37 @@ You need to set the corresponding environment variables: [source,shell] ---- -$ export brokers=<YOUR_KAFKA_BROKERS_URL> +export brokers=<YOUR_KAFKA_BROKERS_URL> ---- - SASL Plain [source,shell] ---- -$ export brokers=<YOUR_KAFKA_BROKERS_URL> -$ export id=<YOUR_KAFKA_SASL_CLIENT_ID> -$ export secret=<YOUR_KAFKA_SASL_CLIENT_SECRET> +export brokers=<YOUR_KAFKA_BROKERS_URL> +export id=<YOUR_KAFKA_SASL_CLIENT_ID> +export secret=<YOUR_KAFKA_SASL_CLIENT_SECRET> ---- - SASL Oauth Bearer [source,shell] ---- -$ export brokers=<YOUR_KAFKA_BROKERS_URL> -$ export id=<YOUR_KAFKA_SASL_CLIENT_ID> -$ export secret=<YOUR_KAFKA_SASL_CLIENT_SECRET> -$ export token=<YOUR_KAFKA_SASL_OAUTHBEARER_TOKEN_URL> +export brokers=<YOUR_KAFKA_BROKERS_URL> +export id=<YOUR_KAFKA_SASL_CLIENT_ID> +export secret=<YOUR_KAFKA_SASL_CLIENT_SECRET> +export token=<YOUR_KAFKA_SASL_OAUTHBEARER_TOKEN_URL> ---- If you want to deploy on Kubernetes or Openshift, you'd need to define the above environment variables in a secret named `camel-kafka`. Set the needed values in the `kubefiles/secret-example.yml`, then add the secret : [source,shell] ---- -$ kubectl apply -f kubefiles/secret-example.yml +kubectl apply -f kubefiles/secret-example.yml ---- ==== JVM mode [source,shell] ---- -$ mvn clean package -DskipTests -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package -DskipTests +java -jar target/quarkus-app/quarkus-run.jar ---- ==== Native mode @@ -119,8 +119,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -DskipTests -Dnative -$ ./target/*-runner +mvn clean package -DskipTests -Dnative +./target/*-runner ---- ==== Deploying to Kubernetes @@ -135,7 +135,7 @@ Build the application using the `kubernetes` profile. [source,shell] ---- -$ mvn clean package -DskipTests -Dkubernetes +mvn clean package -DskipTests -Dkubernetes ---- The `kubernetes` profile uses quarkus kubernetes and jib container extensions, as described in the `pom.xml`. @@ -164,7 +164,7 @@ Example when using Strimzi operator, with a Kafka instance named `Test` : [source,shell] ---- -$ kubectl get pods +kubectl get pods NAME READY STATUS RESTARTS AGE camel-quarkus-examples-kafka-dbc56974b-ph29m 1/1 Running 0 2m34s test-entity-operator-7cccff5899-dlfx8 3/3 Running 0 48m @@ -181,15 +181,15 @@ Tail the application logs. [source,shell] ---- -$ kubectl logs -f camel-quarkus-examples-kafka-dbc56974b-ph29m +kubectl logs -f camel-quarkus-examples-kafka-dbc56974b-ph29m ---- To clean up do. [source,shell] ---- -$ kubectl delete all -l app.kubernetes.io/name=camel-quarkus-examples-kafka -$ kubectl delete secret camel-kafka +kubectl delete all -l app.kubernetes.io/name=camel-quarkus-examples-kafka +kubectl delete secret camel-kafka ---- [NOTE] @@ -205,7 +205,7 @@ Uncomment the creating container with openshift and secrets, in the Openshift sp [source,shell] ---- -$ mvn clean package -DskipTests -Dquarkus.kubernetes.deploy=true -Dopenshift +mvn clean package -DskipTests -Dquarkus.kubernetes.deploy=true -Dopenshift ---- The `openshift` profile uses quarkus openshift and openshift-container extensions, as described in the `pom.xml`. diff --git a/kamelet-chucknorris/README.adoc b/kamelet-chucknorris/README.adoc index 64ce3a1e..3e899e91 100644 --- a/kamelet-chucknorris/README.adoc +++ b/kamelet-chucknorris/README.adoc @@ -16,7 +16,7 @@ and other general information. [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -39,8 +39,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. ---- @@ -54,8 +54,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.013s. ... diff --git a/message-bridge/README.adoc b/message-bridge/README.adoc index 35821d07..86d38373 100644 --- a/message-bridge/README.adoc +++ b/message-bridge/README.adoc @@ -8,7 +8,8 @@ and other general information. == Overview -In this example, a basic REST endpoint is provided for users to dispatch a message to the IBM MQ queue. Subsequently, all messages from the IBM MQ are relayed to an ActiveMQ queue within an XA transaction. To showcase the transaction functionality, a message containing the keyword "rollback" will initiate a transaction rollback. To demonstrate the process of a transaction recovery after a crash, send a message with the keyword "crash". +This example provides a REST endpoint to dispatch messages to the IBM MQ queue. Subsequently, all messages from the IBM MQ are relayed to an ActiveMQ queue within an XA transaction. To show +case the transaction functionality, a message containing the keyword "rollback" will initiate a transaction rollback. To demonstrate the process of a transaction recovery after a crash, send a message with the keyword "crash". Details regarding client configurations can be located in the `src/main/resources/application.properties` file. @@ -21,7 +22,7 @@ docker run \ -e AMQ_USER=admin \ -e AMQ_PASSWORD=admin \ -p 61616:61616 \ - quay.io/arkmq-org/activemq-artemis-broker + quay.io/arkmq-org/activemq-artemis-broker:artemis.2.52.0 ---- Then start the IBM MQ broker: @@ -39,7 +40,7 @@ docker run \ [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -134,8 +135,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. ---- diff --git a/message-bridge/src/main/resources/resources.yml b/message-bridge/src/main/resources/resources.yml index c7037fbc..1afc6308 100644 --- a/message-bridge/src/main/resources/resources.yml +++ b/message-bridge/src/main/resources/resources.yml @@ -33,7 +33,7 @@ spec: spec: containers: - name: activemq - image: quay.io/artemiscloud/activemq-artemis-broker + image: quay.io/arkmq-org/activemq-artemis-broker:artemis.2.52.0 ports: - containerPort: 61616 env: diff --git a/netty-custom-correlation/README.adoc b/netty-custom-correlation/README.adoc index fb0e165b..9032fa05 100644 --- a/netty-custom-correlation/README.adoc +++ b/netty-custom-correlation/README.adoc @@ -10,7 +10,7 @@ and other general information. [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -40,8 +40,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. ---- @@ -55,8 +55,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.013s. ... diff --git a/observability/README.adoc b/observability/README.adoc index 1d172954..a2813955 100644 --- a/observability/README.adoc +++ b/observability/README.adoc @@ -10,7 +10,7 @@ and other general information. [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -36,7 +36,7 @@ The `camel-quarkus-observability-services` extension exposes the above capabilit === Metrics You can benefit from both of the https://camel.apache.org/components/next/micrometer-component.html[Camel Micrometer] and https://quarkus.io/guides/micrometer[Quarkus Micrometer] worlds. -We are able to use multiple ways of creating meters for our custom metrics. +You can create meters in multiple ways for custom metrics. First using Camel micrometer component (see link:src/main/java/org/acme/observability/Routes.java[Routes.java]): @@ -107,14 +107,14 @@ To view all Camel metrics do: [source,shell] ---- -$ curl -s localhost:9876/observe/metrics +curl -s localhost:9876/observe/metrics ---- To view only our previously created metrics, use: [source,shell] ---- -$ curl -s localhost:9876/observe/metrics | grep -i 'purpose="example"' +curl -s localhost:9876/observe/metrics | grep -i 'purpose="example"' ---- and you should see 3 lines of different metrics (with the same value, as they are all triggered by the timer). @@ -127,12 +127,12 @@ Camel provides some out of the box liveness and readiness checks. To see this wo [source,shell] ---- -$ curl -s localhost:9876/observe/health/live +curl -s localhost:9876/observe/health/live ---- [source,shell] ---- -$ curl -s localhost:9876/observe/health/ready +curl -s localhost:9876/observe/health/ready ---- The JSON output will contain a checks for verifying whether the `CamelContext` and each individual route is in the 'Started' state. @@ -207,11 +207,11 @@ The easiest way to visualize the dashboard with working metrics is using Docker [source,shell] ---- # Start the observability stack (Grafana, Prometheus, Tempo) -$ docker compose -f src/main/docker/docker-compose-grafana.yml up -d +docker compose -f src/main/docker/docker-compose-grafana.yml up -d # In another terminal, package and run the application -$ mvn clean package -DskipTests -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package -DskipTests +java -jar target/quarkus-app/quarkus-run.jar ---- Access Grafana at http://localhost:3000 (credentials: `admin/admin`). The dashboard is automatically provisioned and ready to use! @@ -224,7 +224,7 @@ When running in dev mode, Quarkus automatically provisions a Grafana instance wi [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- IMPORTANT: The LGTM dev services Grafana can display *distributed traces* but cannot display *metrics* from the dashboard panels. This is because the Prometheus instance inside the LGTM container cannot scrape metrics from `localhost:9876` on the host machine. For full dashboard functionality, use the Docker Compose setup above. @@ -274,7 +274,7 @@ When the application is running, the dashboard will show: + [source,shell] ---- -$ curl localhost:8080/greeting +curl localhost:8080/greeting ---- - *Distributed Traces*: Click "Open Tempo Explore" to view complete trace hierarchy with 8 spans showing message flow through Camel endpoints @@ -305,15 +305,15 @@ You can interact with the https://jolokia.org[Jolokia] endpoint using cURL. For [source,shell] ---- -$ curl -s 'http://localhost:8778/jolokia/read/org.apache.camel:context=*,type=context,name=*' | jq +curl -s 'http://localhost:8778/jolokia/read/org.apache.camel:context=*,type=context,name=*' | jq ---- https://hawt.io/[Hawtio] can be used to visualize your Camel routes. https://www.jbang.dev/[JBang] is a convenient way to get started. [source,shell] ---- -$ jbang app install hawtio@hawtio/hawtio -$ hawtio --port 8085 +jbang app install hawtio@hawtio/hawtio +hawtio --port 8085 ---- When this example project is run in dev mode, it will be discoverable from Hawtio via the 'Discover' tab. @@ -332,8 +332,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. Listening on: http://0.0.0.0:8080 ---- @@ -347,8 +347,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.013s. Listening on: http://0.0.0.0:8080 ... diff --git a/openapi-contract-first/README.adoc b/openapi-contract-first/README.adoc index 3c2a8531..a7832521 100644 --- a/openapi-contract-first/README.adoc +++ b/openapi-contract-first/README.adoc @@ -22,7 +22,7 @@ and other general information. [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -46,8 +46,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. ---- @@ -61,8 +61,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.013s. ... diff --git a/platform-http-security-keycloak/README.adoc b/platform-http-security-keycloak/README.adoc index 691298cd..8421a50f 100644 --- a/platform-http-security-keycloak/README.adoc +++ b/platform-http-security-keycloak/README.adoc @@ -11,9 +11,8 @@ and other general information. The example application requires a Keycloak instance. -You do not need to provide the Keycloak instance yourself -as long as you play with the example code in dev mode (a.k.a. `mvn quarkus:dev`) - read more https://quarkus.io/guides/getting-started#development-mode[here] -or as long as you only run the supplied tests (`mvn test`). +You don't need to provide a Keycloak instance when running in dev mode (a.k.a. `mvn quarkus:dev`) - read more https://quarkus.io/guides/getting-started#development-mode[here] +or when running the supplied tests (`mvn test`). In those situations, Quarkus tooling starts a Keycloak image for you via https://quarkus.io/guides/security-openid-connect-dev-services[Quarkus Dev Services], and it also configures the application so that you do not need touch anything in `application.properties`. @@ -40,8 +39,8 @@ TIP: If you want to use another running instance, in dev mode. Change `%prod` pr [source,shell] ---- -$ export QUARKUS_OIDC_CREDENTIALS_SECRET=abcdefghijklmnopqrstuvwxyz # You can change it as you wish -$ mvn clean compile quarkus:dev +export QUARKUS_OIDC_CREDENTIALS_SECRET=abcdefghijklmnopqrstuvwxyz # You can change it as you wish +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application, starts Keycloak instance via Dev Services and lets the Quarkus tooling watch for changes in your @@ -62,14 +61,14 @@ For the `employee` user, extract value from response of key `access_token` and c [source,shell] ---- -$ curl -d "client_id=quarkus-client" -d "client_secret=$QUARKUS_OIDC_CREDENTIALS_SECRET" -d "username=employee" -d "password=employee-pass" -d "grant_type=password" $KEYCLOAK_URL/realms/quarkus/protocol/openid-connect/token +curl -d "client_id=quarkus-client" -d "client_secret=$QUARKUS_OIDC_CREDENTIALS_SECRET" -d "username=employee" -d "password=employee-pass" -d "grant_type=password" $KEYCLOAK_URL/realms/quarkus/protocol/openid-connect/token ---- For the `boss` use, extract value from response of key `access_token` and call it `BOSS_TOKEN`: [source,shell] ---- -$ curl -d "client_id=quarkus-client" -d "client_secret=$QUARKUS_OIDC_CREDENTIALS_SECRET" -d "username=boss" -d "password=boss-pass" -d "grant_type=password" $KEYCLOAK_URL/realms/quarkus/protocol/openid-connect/token +curl -d "client_id=quarkus-client" -d "client_secret=$QUARKUS_OIDC_CREDENTIALS_SECRET" -d "username=boss" -d "password=boss-pass" -d "grant_type=password" $KEYCLOAK_URL/realms/quarkus/protocol/openid-connect/token ---- Now we are ready to try some HTTP endpoints: @@ -82,28 +81,28 @@ Now we are ready to try some HTTP endpoints: [source,shell] ---- -$ curl -i -X GET -H "Authorization: Bearer $EMPLOYEE_TOKEN" $APP_URL/secured/authenticated +curl -i -X GET -H "Authorization: Bearer $EMPLOYEE_TOKEN" $APP_URL/secured/authenticated ---- - `employee` accessing an authorized endpoint (you should receive `403 Forbidden`): [source,shell] ---- -$ curl -i -X GET -H "Authorization: Bearer $EMPLOYEE_TOKEN" $APP_URL/secured/authorized +curl -i -X GET -H "Authorization: Bearer $EMPLOYEE_TOKEN" $APP_URL/secured/authorized ---- - `boss` accessing an authenticated endpoint (you should receive `200 OK` + `You are authenticated user so you can perform this action.` message): [source,shell] ---- -$ curl -i -X GET -H "Authorization: Bearer $BOSS_TOKEN" $APP_URL/secured/authenticated +curl -i -X GET -H "Authorization: Bearer $BOSS_TOKEN" $APP_URL/secured/authenticated ---- - `boss` accessing an authorized endpoint (you should receive `200 OK` + `You are authorized to perform sensitive operation.`): [source,shell] ---- -$ curl -i -X GET -H "Authorization: Bearer $BOSS_TOKEN" $APP_URL/secured/authorized +curl -i -X GET -H "Authorization: Bearer $BOSS_TOKEN" $APP_URL/secured/authorized ---- [[external-keycloak-instance-configuration]] @@ -114,7 +113,7 @@ For the next steps, we need to have an externally running Keycloak instance. Thi [source,shell] ---- -$ docker run --name keycloak_test -p 8082:8080 \ +docker run --name keycloak_test -p 8082:8080 \ -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin \ quay.io/keycloak/keycloak:latest \ start-dev @@ -139,9 +138,9 @@ Go to `Configure` left panel and select `quarkus-client` under `Clients`. Go to [source,shell] ---- -$ export QUARKUS_OIDC_CREDENTIALS_SECRET=<insert-your-secret> -$ mvn clean package -DskipTests -$ java -jar target/quarkus-app/quarkus-run.jar +export QUARKUS_OIDC_CREDENTIALS_SECRET=<insert-your-secret> +mvn clean package -DskipTests +java -jar target/quarkus-app/quarkus-run.jar ---- Now you can go to the <<playground>> section (with the assumption that `KEYCLOAK_URL=http://localhost:8082` and `APP_URL=http://localhost:8080`) and try it yourself. @@ -155,9 +154,9 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ export QUARKUS_OIDC_CREDENTIALS_SECRET=<insert-your-secret> -$ mvn clean package -DskipTests -Dnative -$ ./target/*-runner +export QUARKUS_OIDC_CREDENTIALS_SECRET=<insert-your-secret> +mvn clean package -DskipTests -Dnative +./target/*-runner ---- Now you can go to the <<playground>> section (with the assumption that `KEYCLOAK_URL=http://localhost:8082` and `APP_URL=http://localhost:8080`) and try it yourself. @@ -184,8 +183,8 @@ TIP: To trust self-signed certificates from the Kubernetes API server use `-Dqua [source,shell] ---- -$ kubectl create secret generic quarkus-keycloak --from-literal=QUARKUS_OIDC_CREDENTIALS_SECRET=<YOUR_SECRET> -$ mvn clean package -DskipTests -Dquarkus.kubernetes.env.vars.QUARKUS_OIDC_AUTH_SERVER_URL=$BASE_KEYCLOAK_KUBERNETES_URL/realms/quarkus -Dquarkus.oidc.tls.verification=none -Dquarkus.kubernetes.ingress.expose=true -Dquarkus.kubernetes.deploy=true -Dkubernetes +kubectl create secret generic quarkus-keycloak --from-literal=QUARKUS_OIDC_CREDENTIALS_SECRET=<YOUR_SECRET> +mvn clean package -DskipTests -Dquarkus.kubernetes.env.vars.QUARKUS_OIDC_AUTH_SERVER_URL=$BASE_KEYCLOAK_KUBERNETES_URL/realms/quarkus -Dquarkus.oidc.tls.verification=none -Dquarkus.kubernetes.ingress.expose=true -Dquarkus.kubernetes.deploy=true -Dkubernetes ---- The `kubernetes` profile uses quarkus kubernetes and openshift-container extensions, as described in the `pom.xml`. @@ -208,7 +207,7 @@ You can check the pod status: [source,shell] ---- -$ kubectl get pods +kubectl get pods NAME READY STATUS RESTARTS AGE camel-quarkus-examples-platform-http-security-6f658784dd-kxcg8 1/1 Running 0 10m keycloak-57d89d998-rfkk7 @@ -222,8 +221,8 @@ To clean up do: [source,shell] ---- -$ kubectl delete all -l app.kubernetes.io/name=camel-quarkus-examples-platform-http-security -$ kubectl delete secret quarkus-keycloak +kubectl delete all -l app.kubernetes.io/name=camel-quarkus-examples-platform-http-security +kubectl delete secret quarkus-keycloak ---- == Deploying to OpenShift @@ -238,7 +237,7 @@ Use the same configuration as in <<external-keycloak-instance-configuration>> an [source,shell] ---- -$ export BASE_KEYCLOAK_OPENSHIFT_ROUTE_URL=$(oc get route keycloak --template='{{ .spec.host }}') +export BASE_KEYCLOAK_OPENSHIFT_ROUTE_URL=$(oc get route keycloak --template='{{ .spec.host }}') ---- === Deploy Camel Quarkus application to OpenShift @@ -249,8 +248,8 @@ TIP: To trust self-signed certificates from Kubernetes API server use `-Dquarkus [source,shell] ---- -$ oc create secret generic quarkus-keycloak --from-literal=QUARKUS_OIDC_CREDENTIALS_SECRET=<YOUR_SECRET> -$ mvn clean package -DskipTests -Dquarkus.openshift.env.vars.QUARKUS_OIDC_AUTH_SERVER_URL=https://$BASE_KEYCLOAK_OPENSHIFT_ROUTE_URL/realms/quarkus -Dquarkus.oidc.tls.verification=none -Dquarkus.openshift.route.expose=true -Dquarkus.kubernetes.deploy=true -Dopenshift +oc create secret generic quarkus-keycloak --from-literal=QUARKUS_OIDC_CREDENTIALS_SECRET=<YOUR_SECRET> +mvn clean package -DskipTests -Dquarkus.openshift.env.vars.QUARKUS_OIDC_AUTH_SERVER_URL=https://$BASE_KEYCLOAK_OPENSHIFT_ROUTE_URL/realms/quarkus -Dquarkus.oidc.tls.verification=none -Dquarkus.openshift.route.expose=true -Dquarkus.kubernetes.deploy=true -Dopenshift ---- The `openshift` profile uses quarkus openshift and openshift-container extensions, as described in the `pom.xml`. @@ -273,7 +272,7 @@ You can check the pod status: [source,shell] ---- -$ oc get pods +oc get pods NAME READY STATUS RESTARTS AGE camel-quarkus-examples-platform-http-security-1-build 0/1 Completed 0 23h camel-quarkus-examples-platform-http-security-1-deploy 0/1 Completed 0 23h @@ -286,7 +285,7 @@ Find the app url via: [source,shell] ---- -$ export OPENSHIFT_APP_URL=$(oc get route camel-quarkus-examples-platform-http-security --template='{{ .spec.host }}') +export OPENSHIFT_APP_URL=$(oc get route camel-quarkus-examples-platform-http-security --template='{{ .spec.host }}') ---- Then you can play with the example based on <<playground>> instructions (with the assumption that `KEYCLOAK_URL=https://$BASE_KEYCLOAK_OPENSHIFT_ROUTE_URL` and `APP_URL=$OPENSHIFT_APP_URL`). @@ -295,8 +294,8 @@ To clean up do: [source,shell] ---- -$ oc delete all -l app.kubernetes.io/name=camel-quarkus-examples-platform-http-security -$ oc delete secret quarkus-keycloak +oc delete all -l app.kubernetes.io/name=camel-quarkus-examples-platform-http-security +oc delete secret quarkus-keycloak ---- == Feedback diff --git a/quarkus-rest-json/README.adoc b/quarkus-rest-json/README.adoc index c06c5696..6f0c586e 100644 --- a/quarkus-rest-json/README.adoc +++ b/quarkus-rest-json/README.adoc @@ -19,7 +19,7 @@ In these scenarios, Quarkus automatically provisions a Strimzi container via htt [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application, and enables live reload via Quarkus tooling. @@ -75,37 +75,37 @@ Set the corresponding environment variables: [source,shell] ---- -$ export brokers=<YOUR_KAFKA_BROKERS_URL> +export brokers=<YOUR_KAFKA_BROKERS_URL> ---- - SASL Plain [source,shell] ---- -$ export brokers=<YOUR_KAFKA_BROKERS_URL> -$ export id=<YOUR_KAFKA_SASL_CLIENT_ID> -$ export secret=<YOUR_KAFKA_SASL_CLIENT_SECRET> +export brokers=<YOUR_KAFKA_BROKERS_URL> +export id=<YOUR_KAFKA_SASL_CLIENT_ID> +export secret=<YOUR_KAFKA_SASL_CLIENT_SECRET> ---- - SASL Oauth Bearer [source,shell] ---- -$ export brokers=<YOUR_KAFKA_BROKERS_URL> -$ export id=<YOUR_KAFKA_SASL_CLIENT_ID> -$ export secret=<YOUR_KAFKA_SASL_CLIENT_SECRET> -$ export token=<YOUR_KAFKA_SASL_OAUTHBEARER_TOKEN_URL> +export brokers=<YOUR_KAFKA_BROKERS_URL> +export id=<YOUR_KAFKA_SASL_CLIENT_ID> +export secret=<YOUR_KAFKA_SASL_CLIENT_SECRET> +export token=<YOUR_KAFKA_SASL_OAUTHBEARER_TOKEN_URL> ---- To deploy on Kubernetes or OpenShift, define the above environment variables in a secret named `camel-kafka`. Configure the required values in `kubefiles/secret-example.yml`, then create the secret: [source,shell] ---- -$ kubectl apply -f kubefiles/secret-example.yml +kubectl apply -f kubefiles/secret-example.yml ---- ==== JVM mode [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. Listening on: http://0.0.0.0:8080 ---- @@ -119,8 +119,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.013s. Listening on: http://0.0.0.0:8080 ... diff --git a/rest-json/README.adoc b/rest-json/README.adoc index f7fe52eb..aad00af8 100644 --- a/rest-json/README.adoc +++ b/rest-json/README.adoc @@ -12,7 +12,7 @@ and other general information. [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -37,8 +37,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. Listening on: http://0.0.0.0:8080 ---- @@ -52,8 +52,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.013s. Listening on: http://0.0.0.0:8080 ... diff --git a/rest-keycloak-soap-jms/README.adoc b/rest-keycloak-soap-jms/README.adoc index 8a6c29b3..0430ce7c 100644 --- a/rest-keycloak-soap-jms/README.adoc +++ b/rest-keycloak-soap-jms/README.adoc @@ -90,7 +90,7 @@ Run the application in development mode. Quarkus will automatically start Keyclo [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application, and starts both Keycloak and AMQ Broker instances via Dev Services. @@ -112,14 +112,14 @@ For the `customer` user, extract value from response of key `access_token` and c [source,shell] ---- -$ curl -d "client_id=quarkus-client" -d "client_secret=secret" -d "username=customer" -d "password=customer-pass" -d "grant_type=password" $KEYCLOAK_URL/realms/quarkus/protocol/openid-connect/token +curl -d "client_id=quarkus-client" -d "client_secret=secret" -d "username=customer" -d "password=customer-pass" -d "grant_type=password" $KEYCLOAK_URL/realms/quarkus/protocol/openid-connect/token ---- For the `admin` user, extract value from response of key `access_token` and call it `ADMIN_TOKEN`: [source,shell] ---- -$ curl -d "client_id=quarkus-client" -d "client_secret=secret" -d "username=admin" -d "password=admin-pass" -d "grant_type=password" $KEYCLOAK_URL/realms/quarkus/protocol/openid-connect/token +curl -d "client_id=quarkus-client" -d "client_secret=secret" -d "username=admin" -d "password=admin-pass" -d "grant_type=password" $KEYCLOAK_URL/realms/quarkus/protocol/openid-connect/token ---- Now we are ready to try the HTTP endpoints: @@ -130,7 +130,7 @@ The `customer` user can submit orders (you should receive `200 OK` with the SOAP [source,shell] ---- -$ curl -i -X POST -H "Authorization: Bearer $CUSTOMER_TOKEN" -H "Content-Type: application/json" \ +curl -i -X POST -H "Authorization: Bearer $CUSTOMER_TOKEN" -H "Content-Type: application/json" \ -d '{"productId":"PRODUCT-001","quantity":5}' \ $APP_URL/api/orders/submit ---- @@ -152,7 +152,7 @@ The `admin` user can also submit orders (same SOAP response format): [source,shell] ---- -$ curl -i -X POST -H "Authorization: Bearer $ADMIN_TOKEN" -H "Content-Type: application/json" \ +curl -i -X POST -H "Authorization: Bearer $ADMIN_TOKEN" -H "Content-Type: application/json" \ -d '{"productId":"PRODUCT-002","quantity":10}' \ $APP_URL/api/orders/submit ---- @@ -161,7 +161,7 @@ Without authentication, the request should fail (you should receive `401 Unautho [source,shell] ---- -$ curl -i -X POST -H "Content-Type: application/json" \ +curl -i -X POST -H "Content-Type: application/json" \ -d '{"productId":"PRODUCT-003","quantity":3}' \ $APP_URL/api/orders/submit ---- @@ -172,14 +172,14 @@ The `customer` user cannot access admin endpoints (you should receive `403 Forbi [source,shell] ---- -$ curl -i -X GET -H "Authorization: Bearer $CUSTOMER_TOKEN" $APP_URL/api/admin/users +curl -i -X GET -H "Authorization: Bearer $CUSTOMER_TOKEN" $APP_URL/api/admin/users ---- The `admin` user can access admin endpoints (you should receive `200 OK` with a list of Keycloak users): [source,shell] ---- -$ curl -i -X GET -H "Authorization: Bearer $ADMIN_TOKEN" $APP_URL/api/admin/users +curl -i -X GET -H "Authorization: Bearer $ADMIN_TOKEN" $APP_URL/api/admin/users ---- ==== SOAP Inventory Service @@ -189,7 +189,7 @@ You can test it using a SOAP client tool like SoapUI or curl with SOAP envelope: [source,shell] ---- -$ curl -i -X POST -H "Authorization: Bearer $ADMIN_TOKEN" -H "Content-Type: text/xml" \ +curl -i -X POST -H "Authorization: Bearer $ADMIN_TOKEN" -H "Content-Type: text/xml" \ -d '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <tns:UpdateStockRequest xmlns:tns="http://acme.org/inventory"> @@ -227,7 +227,7 @@ You can start a Keycloak instance easily via Docker: [source,shell] ---- -$ docker run --name keycloak_amq_demo -p 8082:8080 \ +docker run --name keycloak_amq_demo -p 8082:8080 \ -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin \ quay.io/keycloak/keycloak:26.6.1 \ start-dev @@ -267,7 +267,7 @@ You can start an AMQ Broker instance via Docker: [source,shell] ---- -$ docker run --name artemis_amq_demo -d -p 61616:61616 -p 8161:8161 \ +docker run --name artemis_amq_demo -d -p 61616:61616 -p 8161:8161 \ -e AMQ_USER=admin -e AMQ_PASSWORD=admin \ quay.io/arkmq-org/activemq-artemis-broker:artemis.2.52.0 ---- @@ -278,14 +278,14 @@ The broker will be available at `tcp://localhost:61616` for JMS connections and [source,shell] ---- -$ export QUARKUS_OIDC_AUTH_SERVER_URL=http://localhost:8082/realms/quarkus -$ export QUARKUS_OIDC_CLIENT_ID=quarkus-client -$ export QUARKUS_OIDC_CREDENTIALS_SECRET=secret -$ export QUARKUS_ARTEMIS_URL=tcp://localhost:61616 -$ export QUARKUS_ARTEMIS_USERNAME=admin -$ export QUARKUS_ARTEMIS_PASSWORD=admin -$ mvn clean package -DskipTests -$ java -jar target/quarkus-app/quarkus-run.jar +export QUARKUS_OIDC_AUTH_SERVER_URL=http://localhost:8082/realms/quarkus +export QUARKUS_OIDC_CLIENT_ID=quarkus-client +export QUARKUS_OIDC_CREDENTIALS_SECRET=secret +export QUARKUS_ARTEMIS_URL=tcp://localhost:61616 +export QUARKUS_ARTEMIS_USERNAME=admin +export QUARKUS_ARTEMIS_PASSWORD=admin +mvn clean package -DskipTests +java -jar target/quarkus-app/quarkus-run.jar ---- Now you can go to the <<playground>> section (with the assumption that `KEYCLOAK_URL=http://localhost:8082` and `APP_URL=http://localhost:8081`) and try it yourself. @@ -299,14 +299,14 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ export QUARKUS_OIDC_AUTH_SERVER_URL=http://localhost:8082/realms/quarkus -$ export QUARKUS_OIDC_CLIENT_ID=quarkus-client -$ export QUARKUS_OIDC_CREDENTIALS_SECRET=secret -$ export QUARKUS_ARTEMIS_URL=tcp://localhost:61616 -$ export QUARKUS_ARTEMIS_USERNAME=admin -$ export QUARKUS_ARTEMIS_PASSWORD=admin -$ mvn clean package -DskipTests -Dnative -$ ./target/*-runner +export QUARKUS_OIDC_AUTH_SERVER_URL=http://localhost:8082/realms/quarkus +export QUARKUS_OIDC_CLIENT_ID=quarkus-client +export QUARKUS_OIDC_CREDENTIALS_SECRET=secret +export QUARKUS_ARTEMIS_URL=tcp://localhost:61616 +export QUARKUS_ARTEMIS_USERNAME=admin +export QUARKUS_ARTEMIS_PASSWORD=admin +mvn clean package -DskipTests -Dnative +./target/*-runner ---- Now you can go to the <<playground>> section (with the assumption that `KEYCLOAK_URL=http://localhost:8082` and `APP_URL=http://localhost:8081`) and try it yourself. @@ -323,7 +323,7 @@ For a simple Keycloak deployment on Kubernetes: [source,shell] ---- -$ kubectl apply -f - <<EOF +kubectl apply -f - <<EOF apiVersion: v1 kind: Service metadata: @@ -384,7 +384,7 @@ For a simple AMQ Broker deployment on Kubernetes: [source,shell] ---- -$ kubectl apply -f - <<EOF +kubectl apply -f - <<EOF apiVersion: v1 kind: Service metadata: @@ -458,7 +458,7 @@ TIP: To trust self-signed certificates from the Kubernetes API server use `-Dqua [source,shell] ---- -$ kubectl create secret generic quarkus-keycloak \ +kubectl create secret generic quarkus-keycloak \ --from-literal=QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ --from-literal=QUARKUS_ARTEMIS_URL=tcp://artemis-broker:61616 \ --from-literal=QUARKUS_ARTEMIS_USERNAME=admin \ @@ -471,7 +471,7 @@ For local Docker Desktop Kubernetes (without pushing to a registry): [source,shell] ---- -$ mvn clean package -DskipTests -Pkubernetes \ +mvn clean package -DskipTests -Pkubernetes \ -Dquarkus.container-image.build=true \ -Dquarkus.container-image.push=false \ -Dquarkus.kubernetes.image-pull-policy=Never \ @@ -488,7 +488,7 @@ For production clusters with a container registry: [source,shell] ---- -$ mvn clean package -DskipTests -Pkubernetes \ +mvn clean package -DskipTests -Pkubernetes \ -Dquarkus.container-image.registry=<your-registry> \ -Dquarkus.container-image.group=<your-group> \ -Dquarkus.container-image.push=true \ @@ -503,7 +503,7 @@ You can check the pod status: [source,shell] ---- -$ kubectl get pods -l app.kubernetes.io/name=camel-quarkus-examples-rest-keycloak-soap-jms +kubectl get pods -l app.kubernetes.io/name=camel-quarkus-examples-rest-keycloak-soap-jms NAME READY STATUS RESTARTS AGE camel-quarkus-examples-rest-keycloak-soap-jms-xxx-xxx 1/1 Running 0 10m ---- @@ -516,7 +516,7 @@ IMPORTANT: Due to JWT token issuer validation, the access token must be obtained [source,shell] ---- -$ kubectl exec deployment/camel-quarkus-examples-rest-keycloak-soap-jms -- sh -c ' +kubectl exec deployment/camel-quarkus-examples-rest-keycloak-soap-jms -- sh -c ' TOKEN=$(curl -s http://keycloak:8080/realms/quarkus/protocol/openid-connect/token \ -d "username=customer" \ -d "password=customer-pass" \ @@ -541,7 +541,7 @@ Expected response: [source,shell] ---- -$ kubectl exec deployment/camel-quarkus-examples-rest-keycloak-soap-jms -- sh -c ' +kubectl exec deployment/camel-quarkus-examples-rest-keycloak-soap-jms -- sh -c ' CUSTOMER_TOKEN=$(curl -s http://keycloak:8080/realms/quarkus/protocol/openid-connect/token \ -d "username=customer" \ -d "password=customer-pass" \ @@ -560,7 +560,7 @@ Expected: `HTTP 403` [source,shell] ---- -$ kubectl exec deployment/camel-quarkus-examples-rest-keycloak-soap-jms -- sh -c ' +kubectl exec deployment/camel-quarkus-examples-rest-keycloak-soap-jms -- sh -c ' ADMIN_TOKEN=$(curl -s http://keycloak:8080/realms/quarkus/protocol/openid-connect/token \ -d "username=admin" \ -d "password=admin-pass" \ @@ -586,15 +586,15 @@ To clean up all Kubernetes resources: [source,shell] ---- # Delete the application -$ kubectl delete all -l app.kubernetes.io/name=camel-quarkus-examples-rest-keycloak-soap-jms -$ kubectl delete secret quarkus-keycloak -$ kubectl delete ingress camel-quarkus-examples-rest-keycloak-soap-jms +kubectl delete all -l app.kubernetes.io/name=camel-quarkus-examples-rest-keycloak-soap-jms +kubectl delete secret quarkus-keycloak +kubectl delete ingress camel-quarkus-examples-rest-keycloak-soap-jms # Delete Keycloak -$ kubectl delete deployment,service keycloak +kubectl delete deployment,service keycloak # Delete AMQ Broker -$ kubectl delete deployment,service artemis-broker +kubectl delete deployment,service artemis-broker ---- == Feedback diff --git a/saga/README.adoc b/saga/README.adoc index 8a7ade08..69199567 100644 --- a/saga/README.adoc +++ b/saga/README.adoc @@ -24,15 +24,15 @@ and there is 15% probability that the payment service fails. ==== Logical view -image::doc-resources/logic-diagram.png[] +image::doc-resources/logic-diagram.png[Logical diagram showing saga pattern flow between app, flight service, train service, and payment service] ==== Compensating a failure -image::doc-resources/compesate-diagram.png[] +image::doc-resources/compensate-diagram.png[Diagram illustrating compensation flow when payment fails in the saga pattern] ==== Technical view -image::doc-resources/tech-diagram.png[] +image::doc-resources/tech-diagram.png[Technical architecture diagram showing HTTP communication with LRA coordinator and AMQ messaging between services] The communication between services and LRA coordinator (blue connectors) is via HTTP protocol, so every service expose REST endpoints called by the LRA, moreover it calls LRA via REST endpoint @@ -136,7 +136,7 @@ Start Artemis: docker run --name artemis \ -e AMQ_USER=admin -e AMQ_PASSWORD=admin \ -d -p 61616:61616 \ - quay.io/artemiscloud/activemq-artemis-broker + quay.io/arkmq-org/activemq-artemis-broker:artemis.2.52.0 ---- Start Narayana LRA Coordinator Server: @@ -150,7 +150,7 @@ docker run --network host -e QUARKUS_HTTP_PORT=8080 quay.io/jbosstm/lra-coordina [source,shell] ---- -$ mvn clean package +mvn clean package ---- ==== Native mode @@ -162,7 +162,7 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative +mvn clean package -Dnative ---- ==== Run script to execute services locally diff --git a/saga/doc-resources/compesate-diagram.png b/saga/doc-resources/compensate-diagram.png similarity index 100% rename from saga/doc-resources/compesate-diagram.png rename to saga/doc-resources/compensate-diagram.png diff --git a/saga/saga-integration-tests/src/test/java/org/apache/camel/example/saga/SagaTestResource.java b/saga/saga-integration-tests/src/test/java/org/apache/camel/example/saga/SagaTestResource.java index b2fa0000..f1302119 100644 --- a/saga/saga-integration-tests/src/test/java/org/apache/camel/example/saga/SagaTestResource.java +++ b/saga/saga-integration-tests/src/test/java/org/apache/camel/example/saga/SagaTestResource.java @@ -33,7 +33,7 @@ import org.testcontainers.containers.wait.strategy.Wait; public class SagaTestResource implements QuarkusTestResourceLifecycleManager { private static final String LRA_IMAGE = "quay.io/jbosstm/lra-coordinator:7.0.1.Final-3.8.3"; - private static final String ARTEMIS_IMAGE = "quay.io/arkmq-org/activemq-artemis-broker:artemis.2.51.0"; + private static final String ARTEMIS_IMAGE = "quay.io/arkmq-org/activemq-artemis-broker:artemis.2.52.0"; private static final int LRA_PORT = 8080; private static final int ARTEMIS_PORT = 61616; diff --git a/spring-redis/README.adoc b/spring-redis/README.adoc index 74bb13f6..cb523bc9 100644 --- a/spring-redis/README.adoc +++ b/spring-redis/README.adoc @@ -10,7 +10,7 @@ and other general information. [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -41,15 +41,15 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. ---- ==== Native mode -The Redis extension does not work in the native mode. +IMPORTANT: The Redis extension does not support native mode due to limitations with Spring Data Redis and GraalVM native compilation. Please use JVM mode for this example. == Feedback diff --git a/timer-log-main/README.adoc b/timer-log-main/README.adoc index 522ae3f9..b49a452c 100644 --- a/timer-log-main/README.adoc +++ b/timer-log-main/README.adoc @@ -20,7 +20,7 @@ dev mode does not start with an error: [source,shell] ---- -$ mvn clean compile quarkus:dev -Dquarkus.args='Hello 2' +mvn clean compile quarkus:dev -Dquarkus.args='Hello 2' ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -45,8 +45,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar Hello 2 +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar Hello 2 ... [example] (Camel (camel-6) thread #8 - timer://foo) Exchange[Body: Hello] [example] (Camel (camel-6) thread #8 - timer://foo) Exchange[Body: Hello] @@ -62,8 +62,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner Hello 2 +mvn clean package -Dnative +./target/*-runner Hello 2 ... [example] (Camel (camel-6) thread #8 - timer://foo) Exchange[Body: Hello] [example] (Camel (camel-6) thread #8 - timer://foo) Exchange[Body: Hello] diff --git a/timer-log/README.adoc b/timer-log/README.adoc index e6f749ad..59a681a8 100644 --- a/timer-log/README.adoc +++ b/timer-log/README.adoc @@ -10,7 +10,7 @@ and other general information. [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -40,8 +40,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. ---- @@ -55,8 +55,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.013s. ... diff --git a/variables/README.adoc b/variables/README.adoc index b32c246b..d044e583 100644 --- a/variables/README.adoc +++ b/variables/README.adoc @@ -10,7 +10,7 @@ and other general information. [source,shell] ---- -$ mvn clean compile quarkus:dev +mvn clean compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your @@ -39,8 +39,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ... [io.quarkus] (main) camel-quarkus-examples-... started in 1.163s. ---- @@ -54,8 +54,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ... [io.quarkus] (main) camel-quarkus-examples-... started in 0.013s. ... diff --git a/vertx-websocket-chat/README.adoc b/vertx-websocket-chat/README.adoc index 9d7c62fa..3222587e 100644 --- a/vertx-websocket-chat/README.adoc +++ b/vertx-websocket-chat/README.adoc @@ -12,7 +12,7 @@ You can run your application in dev mode that enables live coding using: [source,shell] ---- -$ mvn compile quarkus:dev +mvn compile quarkus:dev ---- The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your workspace. Any modifications in your project will automatically take effect in the running application. You can find the application running http://localhost:8080 @@ -34,8 +34,8 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_ [source,shell] ---- -$ mvn clean package -$ java -jar target/quarkus-app/quarkus-run.jar +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar ---- ==== Native mode @@ -47,8 +47,8 @@ To prepare a native executable using GraalVM, run the following command: [source,shell] ---- -$ mvn clean package -Dnative -$ ./target/*-runner +mvn clean package -Dnative +./target/*-runner ---- == Feedback
