This is an automated email from the ASF dual-hosted git repository. marat pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-karavan.git
commit 5dd960a9987d74403bcacf2c12686e671617f937 Author: Marat Gubaidullin <ma...@talismancloud.io> AuthorDate: Sat Feb 10 18:21:10 2024 -0500 Remove outdated demos --- karavan-demo/aggregator/Aggregator.java | 21 - karavan-demo/aggregator/aggregator.yaml | 27 - karavan-demo/aggregator/application.properties | 13 - karavan-demo/aggregator/file_src/1.txt | 1 - karavan-demo/aggregator/file_src/2.txt | 1 - karavan-demo/aggregator/file_src/3.txt | 1 - karavan-demo/expose-pod-service/Readme.md | 12 - .../quarkus/Responseprocessor.java | 20 - .../quarkus/application.properties | 15 - .../quarkus/integration-yaml.camel.yaml | 14 - .../spring/Responseprocessor.java | 20 - .../spring/application.properties | 20 - .../spring/integration.camel.yaml | 15 - karavan-demo/hello-world/application.properties | 11 - karavan-demo/hello-world/hello-world.yaml | 10 - .../artemis/Dockerfile-adoptopenjdk-11 | 69 -- .../jms-to-kafka/artemis/Dockerfile-centos | 69 -- .../jms-to-kafka/artemis/Dockerfile-debian | 69 -- karavan-demo/jms-to-kafka/artemis/docker-run.sh | 49 - .../jms-to-kafka/artemis/prepare-docker.sh | 184 ---- karavan-demo/jms-to-kafka/artemis/readme.md | 198 ---- .../docker-compose/docker-compose.yaml | 40 - karavan-demo/jms-to-kafka/docker-compose/start.sh | 7 - karavan-demo/jms-to-kafka/docs/README.md | 58 -- karavan-demo/jms-to-kafka/docs/payment.png | Bin 366631 -> 0 bytes karavan-demo/jms-to-kafka/project/payment.yaml | 18 - karavan-demo/openapi/open-api.json | 1093 -------------------- .../parceldemo/artemis/Dockerfile-adoptopenjdk-11 | 69 -- karavan-demo/parceldemo/artemis/Dockerfile-centos | 69 -- karavan-demo/parceldemo/artemis/Dockerfile-debian | 69 -- karavan-demo/parceldemo/artemis/docker-run.sh | 49 - karavan-demo/parceldemo/artemis/prepare-docker.sh | 184 ---- karavan-demo/parceldemo/artemis/readme.md | 198 ---- .../parceldemo/docker-compose/docker-compose.yaml | 64 -- .../parceldemo/docker-compose/postgres_db.sql | 6 - karavan-demo/parceldemo/docker-compose/start.sh | 7 - karavan-demo/parceldemo/docs/README.md | 107 -- karavan-demo/parceldemo/docs/operators.png | Bin 96712 -> 0 bytes karavan-demo/parceldemo/docs/parcels.png | Bin 326798 -> 0 bytes .../openshift-manifests/instances/amq-broker.yaml | 48 - .../openshift-manifests/instances/amq-streams.yaml | 33 - .../instances/kustomization.yaml | 6 - .../openshift-manifests/instances/postgresql.yaml | 168 --- .../operators/amq-operator.yaml | 11 - .../operators/amq-streams-operator.yaml | 13 - .../operators/kustomization.yaml | 7 - .../operators/operator-group.yaml | 7 - .../parceldemo/project/application.properties | 15 - karavan-demo/parceldemo/project/parceldemo.yaml | 133 --- karavan-demo/placeholder/application.properties | 33 - karavan-demo/placeholder/demo.yaml | 9 - karavan-demo/placeholder/local.properties | 21 - .../rest-service/quarkus/CreateNewUser.java | 14 - .../rest-service/quarkus/DeleteUserById.java | 15 - karavan-demo/rest-service/quarkus/GetAllUsers.java | 16 - karavan-demo/rest-service/quarkus/GetUserById.java | 15 - karavan-demo/rest-service/quarkus/Readme.md | 11 - .../rest-service/quarkus/application.properties | 15 - karavan-demo/rest-service/quarkus/users.yaml | 78 -- 59 files changed, 3545 deletions(-) diff --git a/karavan-demo/aggregator/Aggregator.java b/karavan-demo/aggregator/Aggregator.java deleted file mode 100644 index 6182b729..00000000 --- a/karavan-demo/aggregator/Aggregator.java +++ /dev/null @@ -1,21 +0,0 @@ -import org.apache.camel.BindToRegistry; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.Exchange; -import org.apache.camel.AggregationStrategy; -import java.util.ArrayList; - -@BindToRegistry("aggregator") -public class Aggregator implements AggregationStrategy { - - public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { - if (oldExchange == null) { - return newExchange; - } - - String oldBody = oldExchange.getIn().getBody(String.class); - String newBody = newExchange.getIn().getBody(String.class); - oldExchange.getIn().setBody(oldBody + "+" + newBody); - return oldExchange; - } -} \ No newline at end of file diff --git a/karavan-demo/aggregator/aggregator.yaml b/karavan-demo/aggregator/aggregator.yaml deleted file mode 100644 index f5157149..00000000 --- a/karavan-demo/aggregator/aggregator.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: camel.apache.org/v1 -kind: Integration -metadata: - name: testflow -spec: - flows: - - route: - from: - uri: timer:test - steps: - - setBody: - expression: - constant: - expression: Sample message - - log: - message: ${body} - - pollEnrich: - expression: - simple: - expression: file:file_src?noop=true - aggregationStrategy: '#aggregator' - timeout: '1000' - - log: - message: 'polled: ${body}' - parameters: - delay: '1000' - period: '3000' diff --git a/karavan-demo/aggregator/application.properties b/karavan-demo/aggregator/application.properties deleted file mode 100644 index 184f7507..00000000 --- a/karavan-demo/aggregator/application.properties +++ /dev/null @@ -1,13 +0,0 @@ - -camel.jbang.project-id=aggregator -camel.jbang.project-name=Aggregator -camel.jbang.project-description=Aggregator -camel.jbang.gav=org.camel.karavan.demo:aggregator:1.0.0 -camel.jbang.runtime=quarkus -camel.jbang.quarkusVersion=2.16.7.Final -camel.jbang.dependencies=mvn:io.quarkus:quarkus-container-image-jib,mvn:org.apache.camel.quarkus:camel-quarkus-microprofile-health,camel:file -camel.health.enabled=true -camel.health.exposure-level=full -quarkus.container-image.group=karavan -quarkus.container-image.name=aggregator -quarkus.openshift.labels."app.openshift.io/runtime"=camel \ No newline at end of file diff --git a/karavan-demo/aggregator/file_src/1.txt b/karavan-demo/aggregator/file_src/1.txt deleted file mode 100644 index 56a6051c..00000000 --- a/karavan-demo/aggregator/file_src/1.txt +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/karavan-demo/aggregator/file_src/2.txt b/karavan-demo/aggregator/file_src/2.txt deleted file mode 100644 index d8263ee9..00000000 --- a/karavan-demo/aggregator/file_src/2.txt +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/karavan-demo/aggregator/file_src/3.txt b/karavan-demo/aggregator/file_src/3.txt deleted file mode 100644 index e440e5c8..00000000 --- a/karavan-demo/aggregator/file_src/3.txt +++ /dev/null @@ -1 +0,0 @@ -3 \ No newline at end of file diff --git a/karavan-demo/expose-pod-service/Readme.md b/karavan-demo/expose-pod-service/Readme.md deleted file mode 100644 index 20b7cd27..00000000 --- a/karavan-demo/expose-pod-service/Readme.md +++ /dev/null @@ -1,12 +0,0 @@ - -1. These examples expose NodePort service for the Integration. -2. Services can be listed by executing command - ``` - kubectl get svc - ``` -2. The integration code creates a TCP listener. You can connect to it using any TCP client like telnet. - ``` - telnet your-node-ip Nodeport - ``` -3. Tcp connection can be disconnected by typing `quit` - diff --git a/karavan-demo/expose-pod-service/quarkus/Responseprocessor.java b/karavan-demo/expose-pod-service/quarkus/Responseprocessor.java deleted file mode 100644 index fab2dad9..00000000 --- a/karavan-demo/expose-pod-service/quarkus/Responseprocessor.java +++ /dev/null @@ -1,20 +0,0 @@ -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import javax.inject.Named; -import javax.inject.Singleton; -import java.lang.String; - -@Singleton -@Named("ResponseProcessor") -public class Responseprocessor implements Processor { - - public void process(Exchange exchange) throws Exception { - if(exchange.getIn().getBody(String.class).contains("quit")) { - System.out.println("received Quit"); - exchange.getOut().setHeader("CamelNettyCloseChannelWhenComplete", true); - } - else { - exchange.getOut().setBody("Hello from Karavan Pod"); - } - } -} \ No newline at end of file diff --git a/karavan-demo/expose-pod-service/quarkus/application.properties b/karavan-demo/expose-pod-service/quarkus/application.properties deleted file mode 100644 index c610057d..00000000 --- a/karavan-demo/expose-pod-service/quarkus/application.properties +++ /dev/null @@ -1,15 +0,0 @@ -camel.karavan.project-id=nodeportexpose -camel.karavan.project-name=NodePortExpose -camel.karavan.project-description=Example to show the way to expose POD port via NodePort service -camel.jbang.gav=org.camel.karavan.demo:nodeportexpose:1 -camel.jbang.runtime=quarkus -camel.jbang.quarkusVersion=2.16.7.Final -camel.jbang.dependencies=camel:microprofile-health,mvn:io.quarkus:quarkus-kubernetes,mvn:io.quarkus:quarkus-container-image-jib -camel.health.enabled=true -camel.health.exposure-level=full -quarkus.container-image.name=nodeportexpose -quarkus.kubernetes.replicas=2 -quarkus.kubernetes.ports."ports".host-port=30010 -quarkus.kubernetes.ports."ports".container-port=8000 -quarkus.kubernetes.service-type=NodePort -quarkus.kubernetes.ports."ports".node-port=30010 \ No newline at end of file diff --git a/karavan-demo/expose-pod-service/quarkus/integration-yaml.camel.yaml b/karavan-demo/expose-pod-service/quarkus/integration-yaml.camel.yaml deleted file mode 100644 index bc0c7e2f..00000000 --- a/karavan-demo/expose-pod-service/quarkus/integration-yaml.camel.yaml +++ /dev/null @@ -1,14 +0,0 @@ -- route: - id: route-4bac - from: - uri: 'netty:tcp://0.0.0.0:8000' - id: from-b670 - parameters: - keepAlive: true - steps: - - log: - message: '${body}' - id: log-31e4 - - process: - ref: ResponseProcessor - id: process-7ea2 diff --git a/karavan-demo/expose-pod-service/spring/Responseprocessor.java b/karavan-demo/expose-pod-service/spring/Responseprocessor.java deleted file mode 100644 index fab2dad9..00000000 --- a/karavan-demo/expose-pod-service/spring/Responseprocessor.java +++ /dev/null @@ -1,20 +0,0 @@ -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import javax.inject.Named; -import javax.inject.Singleton; -import java.lang.String; - -@Singleton -@Named("ResponseProcessor") -public class Responseprocessor implements Processor { - - public void process(Exchange exchange) throws Exception { - if(exchange.getIn().getBody(String.class).contains("quit")) { - System.out.println("received Quit"); - exchange.getOut().setHeader("CamelNettyCloseChannelWhenComplete", true); - } - else { - exchange.getOut().setBody("Hello from Karavan Pod"); - } - } -} \ No newline at end of file diff --git a/karavan-demo/expose-pod-service/spring/application.properties b/karavan-demo/expose-pod-service/spring/application.properties deleted file mode 100644 index 5b096537..00000000 --- a/karavan-demo/expose-pod-service/spring/application.properties +++ /dev/null @@ -1,20 +0,0 @@ -camel.karavan.project-id=nodeportexposespring -camel.karavan.project-name=nodeportexposespring -camel.karavan.project-description= This Example shows the way to expose POD port via NodePort service -camel.jbang.gav=org.camel.karavan.demo:nodeportexposespring:1 -camel.jbang.runtime=spring-boot -camel.jbang.dependencies=camel:microprofile-health -camel.health.enabled=true -camel.health.exposure-level=full -management.endpoints.web.exposure.include=health -management.health.probes.enabled=true -management.health.livenessState.enabled=true -management.health.readinessState.enabled=true -management.endpoint.health.show-details=always -jkube.version=1.13.1 -jkube.build.strategy=jib -jkube.imagePullPolicy=IfNotPresent -jkube.enricher.jkube-controller.replicaCount=2 -jkube.enricher.jkube-service.port=30011:8000 -jkube.enricher.jkube-service.type=NodePort -jkube.enricher.jkube-service.protocol=tcp diff --git a/karavan-demo/expose-pod-service/spring/integration.camel.yaml b/karavan-demo/expose-pod-service/spring/integration.camel.yaml deleted file mode 100644 index f520aed9..00000000 --- a/karavan-demo/expose-pod-service/spring/integration.camel.yaml +++ /dev/null @@ -1,15 +0,0 @@ -- route: - id: route-4bac - from: - uri: 'netty:tcp://0.0.0.0:8000' - id: from-b670 - parameters: - keepAlive: true - steps: - - log: - message: '${body}' - id: log-31e4 - - process: - ref: ResponseProcessor - id: process-7ea2 - diff --git a/karavan-demo/hello-world/application.properties b/karavan-demo/hello-world/application.properties deleted file mode 100644 index e02093c4..00000000 --- a/karavan-demo/hello-world/application.properties +++ /dev/null @@ -1,11 +0,0 @@ -message=HELLO WORLD -quarkus.package.type=uber-jar -camel.jbang.dependencies=mvn:io.quarkus:quarkus-container-image-jib:2.9.2.Final,mvn:io.quarkus:quarkus-openshift:2.9.2.Final -camel.main.sourceLocationEnabled=true -camel.main.tracing=false - -quarkus.container-image.group=karavan-demo -quarkus.container-image.name=hello-world -quarkus.container-image.tag=1.0.0 - - diff --git a/karavan-demo/hello-world/hello-world.yaml b/karavan-demo/hello-world/hello-world.yaml deleted file mode 100644 index da1dd38f..00000000 --- a/karavan-demo/hello-world/hello-world.yaml +++ /dev/null @@ -1,10 +0,0 @@ -- route: - from: - uri: kamelet:timer-source - steps: - - log: - message: ${body} - parameters: - period: 2000 - message: '{{message}}' - \ No newline at end of file diff --git a/karavan-demo/jms-to-kafka/artemis/Dockerfile-adoptopenjdk-11 b/karavan-demo/jms-to-kafka/artemis/Dockerfile-adoptopenjdk-11 deleted file mode 100644 index 499f8717..00000000 --- a/karavan-demo/jms-to-kafka/artemis/Dockerfile-adoptopenjdk-11 +++ /dev/null @@ -1,69 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# ActiveMQ Artemis - -FROM adoptopenjdk:11-jre-hotspot -LABEL maintainer="Apache ActiveMQ Team" -# Make sure pipes are considered to determine success, see: https://github.com/hadolint/hadolint/wiki/DL4006 -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -WORKDIR /opt - -ENV ARTEMIS_USER artemis -ENV ARTEMIS_PASSWORD artemis -ENV ANONYMOUS_LOGIN false -ENV EXTRA_ARGS --http-host 0.0.0.0 --relax-jolokia - -# add user and group for artemis -RUN groupadd -g 1001 -r artemis && useradd -r -u 1001 -g artemis artemis \ - && apt-get -qq -o=Dpkg::Use-Pty=0 update && \ - apt-get -qq -o=Dpkg::Use-Pty=0 install -y libaio1 && \ - rm -rf /var/lib/apt/lists/* - -USER artemis - -ADD . /opt/activemq-artemis - -# Web Server -EXPOSE 8161 \ -# JMX Exporter - 9404 \ -# Port for CORE,MQTT,AMQP,HORNETQ,STOMP,OPENWIRE - 61616 \ -# Port for HORNETQ,STOMP - 5445 \ -# Port for AMQP - 5672 \ -# Port for MQTT - 1883 \ -#Port for STOMP - 61613 - -USER root - -RUN mkdir /var/lib/artemis-instance && chown -R artemis.artemis /var/lib/artemis-instance - -COPY ./docker/docker-run.sh / - -USER artemis - -# Expose some outstanding folders -VOLUME ["/var/lib/artemis-instance"] -WORKDIR /var/lib/artemis-instance - -ENTRYPOINT ["/docker-run.sh"] -CMD ["run"] diff --git a/karavan-demo/jms-to-kafka/artemis/Dockerfile-centos b/karavan-demo/jms-to-kafka/artemis/Dockerfile-centos deleted file mode 100644 index b6fe8f09..00000000 --- a/karavan-demo/jms-to-kafka/artemis/Dockerfile-centos +++ /dev/null @@ -1,69 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# ActiveMQ Artemis - -FROM jboss/base-jdk:11 -LABEL maintainer="Apache ActiveMQ Team" -# Make sure pipes are considered to determine success, see: https://github.com/hadolint/hadolint/wiki/DL4006 -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -WORKDIR /opt - -ENV ARTEMIS_USER artemis -ENV ARTEMIS_PASSWORD artemis -ENV ANONYMOUS_LOGIN false -ENV EXTRA_ARGS --http-host 0.0.0.0 --relax-jolokia - -USER root - -# add user and group for artemis -RUN groupadd -g 1001 -r artemis && useradd -r -u 1001 -g artemis artemis \ - && yum install -y libaio && yum -y clean all - -USER artemis - -ADD . /opt/activemq-artemis - -# Web Server -EXPOSE 8161 \ -# JMX Exporter - 9404 \ -# Port for CORE,MQTT,AMQP,HORNETQ,STOMP,OPENWIRE - 61616 \ -# Port for HORNETQ,STOMP - 5445 \ -# Port for AMQP - 5672 \ -# Port for MQTT - 1883 \ -#Port for STOMP - 61613 - -USER root - -RUN mkdir /var/lib/artemis-instance && chown -R artemis.artemis /var/lib/artemis-instance - -COPY ./docker/docker-run.sh / - -USER artemis - -# Expose some outstanding folders -VOLUME ["/var/lib/artemis-instance"] -WORKDIR /var/lib/artemis-instance - -ENTRYPOINT ["/docker-run.sh"] -CMD ["run"] \ No newline at end of file diff --git a/karavan-demo/jms-to-kafka/artemis/Dockerfile-debian b/karavan-demo/jms-to-kafka/artemis/Dockerfile-debian deleted file mode 100644 index 263dbb3a..00000000 --- a/karavan-demo/jms-to-kafka/artemis/Dockerfile-debian +++ /dev/null @@ -1,69 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# ActiveMQ Artemis - -FROM openjdk:11 -LABEL maintainer="Apache ActiveMQ Team" -# Make sure pipes are considered to determine success, see: https://github.com/hadolint/hadolint/wiki/DL4006 -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -WORKDIR /opt - -ENV ARTEMIS_USER artemis -ENV ARTEMIS_PASSWORD artemis -ENV ANONYMOUS_LOGIN false -ENV EXTRA_ARGS --http-host 0.0.0.0 --relax-jolokia - -# add user and group for artemis -RUN groupadd -g 1001 -r artemis && useradd -r -u 1001 -g artemis artemis \ - && apt-get -qq -o=Dpkg::Use-Pty=0 update && \ - apt-get -qq -o=Dpkg::Use-Pty=0 install -y libaio1 && \ - rm -rf /var/lib/apt/lists/* - -USER artemis - -ADD . /opt/activemq-artemis - -# Web Server -EXPOSE 8161 \ -# JMX Exporter - 9404 \ -# Port for CORE,MQTT,AMQP,HORNETQ,STOMP,OPENWIRE - 61616 \ -# Port for HORNETQ,STOMP - 5445 \ -# Port for AMQP - 5672 \ -# Port for MQTT - 1883 \ -#Port for STOMP - 61613 - -USER root - -RUN mkdir /var/lib/artemis-instance && chown -R artemis.artemis /var/lib/artemis-instance - -COPY ./docker/docker-run.sh / - -USER artemis - -# Expose some outstanding folders -VOLUME ["/var/lib/artemis-instance"] -WORKDIR /var/lib/artemis-instance - -ENTRYPOINT ["/docker-run.sh"] -CMD ["run"] diff --git a/karavan-demo/jms-to-kafka/artemis/docker-run.sh b/karavan-demo/jms-to-kafka/artemis/docker-run.sh deleted file mode 100755 index ba7ee681..00000000 --- a/karavan-demo/jms-to-kafka/artemis/docker-run.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - - -# This is the entry point for the docker images. -# This file is executed when docker run is called. - - -set -e - -BROKER_HOME=/var/lib/ -CONFIG_PATH=$BROKER_HOME/etc -export BROKER_HOME OVERRIDE_PATH CONFIG_PATH - -if [[ ${ANONYMOUS_LOGIN,,} == "true" ]]; then - LOGIN_OPTION="--allow-anonymous" -else - LOGIN_OPTION="--require-login" -fi - -CREATE_ARGUMENTS="--user ${ARTEMIS_USER} --password ${ARTEMIS_PASSWORD} --silent ${LOGIN_OPTION} ${EXTRA_ARGS}" - -echo CREATE_ARGUMENTS=${CREATE_ARGUMENTS} - -if ! [ -f ./etc/broker.xml ]; then - /opt/activemq-artemis/bin/artemis create ${CREATE_ARGUMENTS} . -else - echo "broker already created, ignoring creation" -fi - -exec ./bin/artemis "$@" - - diff --git a/karavan-demo/jms-to-kafka/artemis/prepare-docker.sh b/karavan-demo/jms-to-kafka/artemis/prepare-docker.sh deleted file mode 100755 index f14717ca..00000000 --- a/karavan-demo/jms-to-kafka/artemis/prepare-docker.sh +++ /dev/null @@ -1,184 +0,0 @@ -#!/bin/sh -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Setting the script to fail if anything goes wrong -set -e - -#This is a script to Prepare an artemis folder to generate the Release. - - -usage () { - cat <<HERE - -$@ - -Usage: - # Prepare for build the Docker Image from the local distribution - ./prepare-docker.sh --from-local-dist --local-dist-path {local-distribution-directory} - - # Prepare for build the Docker Image from the release version - ./prepare-docker.sh --from-release --artemis-version {release-version} - - # Show the usage command - ./prepare-docker.sh --help - -Example: - ./prepare-docker.sh --from-local-dist --local-dist-path ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT - ./prepare-docker.sh --from-release --artemis-version 2.16.0 - -HERE - exit 1 -} - -next_step () { - cat <<HERE - -Well done! Now you can continue with the Docker image build. -Building the Docker Image: - Go to $ARTEMIS_DIST where you prepared the binary with Docker files. - - # Go to $ARTEMIS_DIST - $ cd $ARTEMIS_DIST - - # For Debian - $ docker build -f ./docker/Dockerfile-debian -t artemis-debian . - - # For CentOS - $ docker build -f ./docker/Dockerfile-centos -t artemis-centos . - - # For AdoptOpen JDK 11 - $ docker build -f ./docker/Dockerfile-adoptopenjdk-11 -t artemis-adoptopenjdk-11 . - - # For AdoptOpen JDK 11 (Build for linux ARMv7/ARM64) - $ docker buildx build --platform linux/arm64,linux/arm/v7 --push -t {your-repository}/apache-artemis:2.17.0-SNAPSHOT -f ./docker/Dockerfile-adoptopenjdk-11 . - -Note: -t artemis-debian, -t artemis-centos and artemis-adoptopenjdk-11 are just -tag names for the purpose of this guide - -For more info read the readme.md - -HERE - exit 0 -} - -while [ "$#" -ge 1 ] -do -key="$1" - case $key in - --help) - usage - ;; - --from-local-dist) - FROM_LOCAL="true" - ;; - --from-release) - FROM_RELEASE="true" - ;; - --local-dist-path) - LOCAL_DIST_PATH="$2" - shift - ;; - --artemis-version) - ARTEMIS_VERSION="$2" - shift - ;; - *) - # unknown option - usage "Unknown option" - ;; - esac - shift -done - -# TMPDIR must be contained within the working directory so it is part of the -# Docker context. (i.e. it can't be mktemp'd in /tmp) -BASE_TMPDIR="_TMP_/artemis" - -cleanup() { - if [ -d "${BASE_TMPDIR}/${ARTEMIS_VERSION}" ] - then - echo "Clean up the ${BASE_TMPDIR}/${ARTEMIS_VERSION} directory" - find "${BASE_TMPDIR}" -name "${ARTEMIS_VERSION}" -type d -mmin +60 -exec rm -rf "{}" \; - else - mkdir -p "${BASE_TMPDIR}/${ARTEMIS_VERSION}" - fi -} - -if [ -n "${FROM_RELEASE}" ]; then - [ -n "${ARTEMIS_VERSION}" ] || usage "You must specify the release version (es.: --artemis-version 2.16.0)" - - cleanup - - ARTEMIS_BASE_URL="$(curl -s https://www.apache.org/dyn/closer.cgi\?preferred=true)activemq/activemq-artemis/${ARTEMIS_VERSION}/" - ARTEMIS_DIST_FILE_NAME="apache-artemis-${ARTEMIS_VERSION}-bin.tar.gz" - CURL_OUTPUT="${BASE_TMPDIR}/${ARTEMIS_VERSION}/${ARTEMIS_DIST_FILE_NAME}" - - if [ -z "$(ls -A ${BASE_TMPDIR}/${ARTEMIS_VERSION})" ] - then - echo "Downloading ${ARTEMIS_DIST_FILE_NAME} from ${ARTEMIS_BASE_URL}..." - curl --progress-bar "${ARTEMIS_BASE_URL}${ARTEMIS_DIST_FILE_NAME}" --output "${CURL_OUTPUT}" - - echo "Expanding ${BASE_TMPDIR}/${ARTEMIS_VERSION}/${ARTEMIS_DIST_FILE_NAME}..." - tar xzf "$CURL_OUTPUT" --directory "${BASE_TMPDIR}/${ARTEMIS_VERSION}" --strip 1 - - echo "Removing ${BASE_TMPDIR}/${ARTEMIS_VERSION}/${ARTEMIS_DIST_FILE_NAME}..." - rm -rf "${BASE_TMPDIR}/${ARTEMIS_VERSION}"/"${ARTEMIS_DIST_FILE_NAME}" - fi - - ARTEMIS_DIST="${BASE_TMPDIR}/${ARTEMIS_VERSION}" - - echo "Using Artemis dist: ${ARTEMIS_DIST}" - -elif [ -n "${FROM_LOCAL}" ]; then - - if [ -n "${LOCAL_DIST_PATH}" ]; then - ARTEMIS_DIST=${LOCAL_DIST_PATH} - echo "Using Artemis dist: ${ARTEMIS_DIST}" - else - usage "You must specify the local distribution directory" - fi - - if [ ! -d "${ARTEMIS_DIST}" ] - then - usage "Directory ${ARTEMIS_DIST} does not exist" - fi - - if [ -d "${ARTEMIS_DIST}/docker" ] - then - echo "Clean up the ${ARTEMIS_DIST}/docker directory" - rm -rf "${ARTEMIS_DIST}/docker" - fi - -else - - usage - -fi - -if [ ! -d "${ARTEMIS_DIST}/docker" ] -then - mkdir "${ARTEMIS_DIST}/docker" -fi - -cp ./Dockerfile-* "$ARTEMIS_DIST/docker" -cp ./docker-run.sh "$ARTEMIS_DIST/docker" - -echo "Docker file support files at : $ARTEMIS_DIST/docker" -tree "$ARTEMIS_DIST/docker" - -next_step \ No newline at end of file diff --git a/karavan-demo/jms-to-kafka/artemis/readme.md b/karavan-demo/jms-to-kafka/artemis/readme.md deleted file mode 100644 index 3f17743d..00000000 --- a/karavan-demo/jms-to-kafka/artemis/readme.md +++ /dev/null @@ -1,198 +0,0 @@ -# Docker Image Example - -This is an example on how you could create your own Docker Image For Apache -ActiveMQ Artemis based on CentOS or Debian (JDK 8) or AdoptOpen JDK 11 (Ubuntu). - -# Preparing - -Use the script ./prepare-docker.sh as it will copy the docker files under the -binary distribution. - -Below is shown the command to prepare the build of the Docker Image starting -from the local distribution (from the source codes of ActiveMQ Artemis) -``` -# Prepare for build the Docker Image from the local distribution. Replace the -# {local-distribution-directory} with your directory. -$ ./prepare-docker.sh --from-local-dist --local-dist-path {local-distribution-directory} -``` - -The output of the previous command is shown below. - -``` -$ ./prepare-docker.sh --from-local-dist --local-dist-path ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT - -Using Artemis dist: ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT -Clean up the ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT/docker directory -Docker file support files at : ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT/docker -../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT/docker -├── Dockerfile-adoptopenjdk-11 -├── Dockerfile-centos -├── Dockerfile-debian -└── docker-run.sh - -0 directories, 4 files - -Well done! Now you can continue with the Docker image build. -Building the Docker Image: - Go to ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT where you prepared the binary with Docker files. - - # Go to ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT - $ cd ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT - - # For Debian - $ docker build -f ./docker/Dockerfile-debian -t artemis-debian . - - # For CentOS - $ docker build -f ./docker/Dockerfile-centos -t artemis-centos . - - # For AdoptOpen JDK 11 - $ docker build -f ./docker/Dockerfile-adoptopenjdk-11 -t artemis-adoptopenjdk-11 . - -Note: -t artemis-debian, -t artemis-centos and artemis-adoptopenjdk-11 are just -tag names for the purpose of this guide - -For more info read the readme.md - -``` - -The command to prepare the build of the Docker Image starting from the official -release of ActiveMQ Artemis is shown below -``` -# Prepare for build the Docker Image from the release version. Replace the -# {release-version} with the version that you want -$ ./prepare-docker.sh --from-release --artemis-version {release-version} -``` - -The output of the previous command is shown below. - -``` -$ ./prepare-docker.sh --from-release --artemis-version 2.16.0 - -Downloading apache-artemis-2.16.0-bin.tar.gz from https://downloads.apache.org/activemq/activemq-artemis/2.16.0/... -################################################################################################################################################################################################################################ 100,0% -Expanding _TMP_/artemis/2.16.0/apache-artemis-2.16.0-bin.tar.gz... -Removing _TMP_/artemis/2.16.0/apache-artemis-2.16.0-bin.tar.gz... -Using Artemis dist: _TMP_/artemis/2.16.0 -Docker file support files at : _TMP_/artemis/2.16.0/docker -_TMP_/artemis/2.16.0/docker -├── Dockerfile-adoptopenjdk-11 -├── Dockerfile-centos -├── Dockerfile-debian -└── docker-run.sh - -0 directories, 4 files - -Well done! Now you can continue with the Docker image build. -Building the Docker Image: - Go to _TMP_/artemis/2.16.0 where you prepared the binary with Docker files. - - # Go to _TMP_/artemis/2.16.0 - $ cd _TMP_/artemis/2.16.0 - - # For Debian - $ docker build -f ./docker/Dockerfile-debian -t artemis-debian . - - # For CentOS - $ docker build -f ./docker/Dockerfile-centos -t artemis-centos . - - # For AdoptOpen JDK 11 - $ docker build -f ./docker/Dockerfile-adoptopenjdk-11 -t artemis-adoptopenjdk-11 . - -Note: -t artemis-debian, -t artemis-centos and artemis-adoptopenjdk-11 are just -tag names for the purpose of this guide - -For more info read the readme.md -``` - -# Building - -Go to `$ARTEMIS_DIST` where you prepared the binary with Docker files. - -## For Debian - -From within the `$ARTEMIS_DIST` folder: -``` -$ docker build -f ./docker/Dockerfile-debian -t artemis-debian . -``` - -## For CentOS - -From within the `$ARTEMIS_DIST` folder: -``` -$ docker build -f ./docker/Dockerfile-centos -t artemis-centos . -``` - -## For AdoptOpen JDK 11 -From within the `$ARTEMIS_DIST` folder: -``` -$ docker build -f ./docker/Dockerfile-adoptopenjdk-11 -t artemis-adoptopenjdk-11 . -``` - -# For AdoptOpen JDK 11 (Build for linux ARMv7/ARM64) -``` -$ docker buildx build --platform linux/arm64,linux/arm/v7 --push -t {your-repository}/apache-artemis:2.17.0-SNAPSHOT -f ./docker/Dockerfile-adoptopenjdk-11 . -``` - -**Note:** -`-t artemis-debian`,`-t artemis-centos`,`artemis-adoptopenjdk-11` are just tag -names for the purpose of this guide - - -# Environment Variables - -Environment variables determine the options sent to `artemis create` on first execution of the Docker -container. The available options are: - -**`ARTEMIS_USER`** - -The administrator username. The default is `artemis`. - -**`ARTEMIS_PASSWORD`** - -The administrator password. The default is `artemis`. - -**`ANONYMOUS_LOGIN`** - -Set to `true` to allow anonymous logins. The default is `false`. - -**`EXTRA_ARGS`** - -Additional arguments sent to the `artemis create` command. The default is `--http-host 0.0.0.0 --relax-jolokia`. -Setting this value will override the default. See the documentation on `artemis create` for available options. - -**Final broker creation command:** - -The combination of the above environment variables results in the `docker-run.sh` script calling -the following command to create the broker instance the first time the Docker container runs: - - ${ARTEMIS_HOME}/bin/artemis create --user ${ARTEMIS_USER} --password ${ARTEMIS_PASSWORD} --silent ${LOGIN_OPTION} ${EXTRA_ARGS} - -Note: `LOGIN_OPTION` is either `--allow-anonymous` or `--require-login` depending on the value of `ANONYMOUS_LOGIN`. - -# Mapping point - -- `/var/lib/artemis-instance` - -It's possible to map a folder as the instance broker. -This will hold the configuration and the data of the running broker. This is useful for when you want the data persisted outside of a container. - - -# Lifecycle of the execution - -A broker instance will be created during the execution of the instance. If you pass a mapped folder for `/var/lib/artemis-instance` an image will be created or reused depending on the contents of the folder. - - - -## Running a CentOS image - -The image just created in the previous step allows both stateless or stateful runs. -The stateless run is achieved by: -``` -$ docker run --rm -it -p 61616:61616 -p 8161:8161 artemis-centos -``` -The image will also support mapped folders and mapped ports. To run the image with the instance persisted on the host: -``` -docker run -it -p 61616:61616 -p 8161:8161 -v <broker folder on host>:/var/lib/artemis-instance artemis-centos -``` -where `<broker folder on host>` is a folder where the broker instance is supposed to -be saved and reused on each run. diff --git a/karavan-demo/jms-to-kafka/docker-compose/docker-compose.yaml b/karavan-demo/jms-to-kafka/docker-compose/docker-compose.yaml deleted file mode 100644 index 42da4f20..00000000 --- a/karavan-demo/jms-to-kafka/docker-compose/docker-compose.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -version: '3.8' -services: - - zookeeper: - container_name: zookeeper - image: confluentinc/cp-zookeeper:latest - ports: - - "2181:2181" - environment: - ZOOKEEPER_CLIENT_PORT: 2181 - ZOOKEEPER_TICK_TIME: 2000 - - kafka: - container_name: kafka - image: confluentinc/cp-kafka:latest - depends_on: - - zookeeper - ports: - - "9092:9092" - environment: - KAFKA_BROKER_ID: 1 - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT - KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - KAFKA_CREATE_TOPICS: "events:1:1" - - artemis: - image: artemis-adoptopenjdk-11:latest - container_name: artemis - environment: - - ARTEMIS_USER=admin - - ARTEMIS_PASSWORD=admin - - ANONYMOUS_LOGIN=true - ports: - - "61616:61616" - - "1883:1883" - - "8161:8161" diff --git a/karavan-demo/jms-to-kafka/docker-compose/start.sh b/karavan-demo/jms-to-kafka/docker-compose/start.sh deleted file mode 100755 index ccb09e38..00000000 --- a/karavan-demo/jms-to-kafka/docker-compose/start.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -docker-compose down -docker rm -f $(docker ps -a -q) -docker volume rm $(docker volume ls -q) -docker-compose up -d -docker-compose logs -f \ No newline at end of file diff --git a/karavan-demo/jms-to-kafka/docs/README.md b/karavan-demo/jms-to-kafka/docs/README.md deleted file mode 100644 index a4f0204d..00000000 --- a/karavan-demo/jms-to-kafka/docs/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# Demo: JMS to Kafka - - - -## Localhost -### Prerequisites - -1. [VSCode](https://code.visualstudio.com/download) installed -2. Apache Camel [Karavan](https://marketplace.visualstudio.com/items?itemName=camel-karavan.karavan) extension installed -3. [JBang](https://www.jbang.dev/download/) installed -4. Docker and Docker compose installed -5. Build Apache Artemis Docker Image -``` -cd ../artemis -./prepare-docker.sh --from-release --artemis-version 2.25.0 -cd _TMP_/artemis/2.25.0 -docker build -f ./docker/Dockerfile-adoptopenjdk-11 -t artemis-adoptopenjdk-11 . -``` -For MacOS users, in case of `tree command not found` error, install tree `brew install tree` - -### Start environment -``` -cd docker-compose -docker-compose up -``` - -### Start integration -``` -jbang -Dcamel.jbang.version=4.3.0 camel@apache/camel run * -``` - -### Publish payment to JMS - -Open AMQ7 Broker Management [Console](http://localhost:8161) - -Send message to `payments` queue -``` -<?xml version="1.0" encoding="UTF-8" ?> -<root> - <id>1</id> - <amount>777</amount> - <status>confirmed</status> -</root> -``` - -### Browse payments from Kafka - -The [kcat](https://github.com/edenhill/kcat) tool can be used to browse messages in Kafka: - -``` -kcat -b localhost -t payments -``` - -Which should output the payment that has been transformed to JSon. - -``` -{"id":"1","amount":"777","status":"confirmed"} -``` diff --git a/karavan-demo/jms-to-kafka/docs/payment.png b/karavan-demo/jms-to-kafka/docs/payment.png deleted file mode 100644 index 9087241a..00000000 Binary files a/karavan-demo/jms-to-kafka/docs/payment.png and /dev/null differ diff --git a/karavan-demo/jms-to-kafka/project/payment.yaml b/karavan-demo/jms-to-kafka/project/payment.yaml deleted file mode 100644 index 3c633b21..00000000 --- a/karavan-demo/jms-to-kafka/project/payment.yaml +++ /dev/null @@ -1,18 +0,0 @@ -- route: - from: - uri: kamelet:jms-apache-artemis-source - steps: - - to: - uri: kamelet:xj-identity-action - parameters: - direction: XML2JSON - - to: - uri: kamelet:kafka-not-secured-sink - parameters: - topic: payments - bootstrapServers: localhost:9092 - parameters: - destinationType: queue - destinationName: payments - brokerURL: tcp://localhost:61616 - id: payment diff --git a/karavan-demo/openapi/open-api.json b/karavan-demo/openapi/open-api.json deleted file mode 100644 index 8c1cf3a0..00000000 --- a/karavan-demo/openapi/open-api.json +++ /dev/null @@ -1,1093 +0,0 @@ -{ - "openapi": "3.0.2", - "info": { - "title": "Swagger Petstore", - "version": "1.0.0", - "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", - "termsOfService": "http://swagger.io/terms/", - "contact": { - "email": "apit...@swagger.io" - }, - "license": { - "name": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - } - }, - "servers": [ - { - "url": "http://petstore.swagger.io/api/v3" - } - ], - "paths": { - "/pet": { - "put": { - "requestBody": { - "description": "Pet object that needs to be added to the store", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "required": true - }, - "tags": [ - "pet" - ], - "responses": { - "400": { - "description": "Invalid ID supplied" - }, - "404": { - "description": "Pet not found" - }, - "405": { - "description": "Validation exception" - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ], - "operationId": "updatePet", - "summary": "Update an existing pet", - "description": "" - }, - "post": { - "requestBody": { - "description": "Pet object that needs to be added to the store", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "required": true - }, - "tags": [ - "pet" - ], - "parameters": [ - { - "name": "verbose", - "description": "Verbose data", - "schema": { - "default": false, - "type": "boolean" - }, - "in": "query" - } - ], - "responses": { - "405": { - "description": "Invalid input" - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ], - "operationId": "addPet", - "summary": "Add a new pet to the store", - "description": "" - } - }, - "/pet/findByStatus": { - "get": { - "tags": [ - "pet" - ], - "parameters": [ - { - "style": "form", - "explode": true, - "name": "status", - "description": "Status values that need to be considered for filter", - "schema": { - "type": "array", - "items": { - "default": "available", - "enum": [ - "available", - "pending", - "sold" - ], - "type": "string" - } - }, - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "content": { - "application/xml": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - } - }, - "description": "successful operation" - }, - "400": { - "description": "Invalid status value" - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ], - "operationId": "findPetsByStatus", - "summary": "Finds Pets by status", - "description": "Multiple status values can be provided with comma separated strings" - } - }, - "/pet/findByTags": { - "get": { - "tags": [ - "pet" - ], - "parameters": [ - { - "style": "form", - "explode": true, - "name": "tags", - "description": "Tags to filter by", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "content": { - "application/xml": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - } - }, - "description": "successful operation" - }, - "400": { - "description": "Invalid tag value" - } - }, - "deprecated": true, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ], - "operationId": "findPetsByTags", - "summary": "Finds Pets by tags", - "description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing." - } - }, - "/pet/{petId}": { - "get": { - "tags": [ - "pet" - ], - "parameters": [ - { - "name": "petId", - "description": "ID of pet to return", - "schema": { - "format": "int64", - "type": "integer" - }, - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "content": { - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "description": "successful operation" - }, - "400": { - "description": "Invalid ID supplied" - }, - "404": { - "description": "Pet not found" - } - }, - "security": [ - { - "api_key": [] - } - ], - "operationId": "getPetById", - "summary": "Find pet by ID", - "description": "Returns a single pet" - }, - "post": { - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "type": "object", - "properties": { - "name": { - "description": "Updated name of the pet", - "type": "string" - }, - "status": { - "description": "Updated status of the pet", - "type": "string" - } - } - } - } - }, - "required": true - }, - "tags": [ - "pet" - ], - "parameters": [ - { - "name": "petId", - "description": "ID of pet that needs to be updated", - "schema": { - "format": "int64", - "type": "integer" - }, - "in": "path", - "required": true - } - ], - "responses": { - "405": { - "description": "Invalid input" - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ], - "operationId": "updatePetWithForm", - "summary": "Updates a pet in the store with form data", - "description": "" - }, - "delete": { - "tags": [ - "pet" - ], - "parameters": [ - { - "name": "api_key", - "schema": { - "type": "string" - }, - "in": "header", - "required": false - }, - { - "name": "petId", - "description": "Pet id to delete", - "schema": { - "format": "int64", - "type": "integer" - }, - "in": "path", - "required": true - } - ], - "responses": { - "400": { - "description": "Invalid ID supplied" - }, - "404": { - "description": "Pet not found" - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ], - "operationId": "deletePet", - "summary": "Deletes a pet", - "description": "" - } - }, - "/pet/{petId}/uploadImage": { - "post": { - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "properties": { - "additionalMetadata": { - "description": "Additional data to pass to server", - "type": "string" - }, - "file": { - "format": "binary", - "description": "file to upload", - "type": "string" - } - } - } - } - }, - "required": true - }, - "tags": [ - "pet" - ], - "parameters": [ - { - "name": "petId", - "description": "ID of pet to update", - "schema": { - "format": "int64", - "type": "integer" - }, - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiResponse" - } - } - }, - "description": "successful operation" - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ], - "operationId": "uploadFile", - "summary": "uploads an image", - "description": "" - } - }, - "/store/inventory": { - "get": { - "tags": [ - "store" - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "format": "int32", - "type": "integer" - } - } - } - }, - "description": "successful operation" - } - }, - "security": [ - { - "api_key": [] - } - ], - "operationId": "getInventory", - "summary": "Returns pet inventories by status", - "description": "Returns a map of status codes to quantities" - } - }, - "/store/order": { - "post": { - "requestBody": { - "description": "order placed for purchasing the pet", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/Order" - } - } - }, - "required": true - }, - "tags": [ - "store" - ], - "responses": { - "200": { - "content": { - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Order" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/Order" - } - } - }, - "description": "successful operation" - }, - "400": { - "description": "Invalid Order" - } - }, - "operationId": "placeOrder", - "summary": "Place an order for a pet", - "description": "" - } - }, - "/store/order/{orderId}": { - "get": { - "tags": [ - "store" - ], - "parameters": [ - { - "name": "orderId", - "description": "ID of pet that needs to be fetched", - "schema": { - "format": "int64", - "maximum": 10, - "minimum": 1, - "type": "integer" - }, - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "content": { - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Order" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/Order" - } - } - }, - "description": "successful operation" - }, - "400": { - "description": "Invalid ID supplied" - }, - "404": { - "description": "Order not found" - } - }, - "operationId": "getOrderById", - "summary": "Find purchase order by ID", - "description": "For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions" - }, - "delete": { - "tags": [ - "store" - ], - "parameters": [ - { - "name": "orderId", - "description": "ID of the order that needs to be deleted", - "schema": { - "format": "int64", - "minimum": 1, - "type": "integer" - }, - "in": "path", - "required": true - } - ], - "responses": { - "400": { - "description": "Invalid ID supplied" - }, - "404": { - "description": "Order not found" - } - }, - "operationId": "deleteOrder", - "summary": "Delete purchase order by ID", - "description": "For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors" - } - }, - "/user": { - "post": { - "requestBody": { - "description": "Created user object", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - }, - "required": true - }, - "tags": [ - "user" - ], - "responses": { - "default": { - "description": "successful operation" - } - }, - "operationId": "createUser", - "summary": "Create user", - "description": "This can only be done by the logged in user." - } - }, - "/user/createWithArray": { - "post": { - "requestBody": { - "description": "List of user object", - "content": { - "*/*": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/User" - } - } - } - }, - "required": true - }, - "tags": [ - "user" - ], - "responses": { - "default": { - "description": "successful operation" - } - }, - "operationId": "createUsersWithArrayInput", - "summary": "Creates list of users with given input array", - "description": "" - } - }, - "/user/createWithList": { - "post": { - "requestBody": { - "description": "List of user object", - "content": { - "*/*": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/User" - } - } - } - }, - "required": true - }, - "tags": [ - "user" - ], - "responses": { - "default": { - "description": "successful operation" - } - }, - "operationId": "createUsersWithListInput", - "summary": "Creates list of users with given input array", - "description": "" - } - }, - "/user/login": { - "get": { - "tags": [ - "user" - ], - "parameters": [ - { - "name": "username", - "description": "The user name for login", - "schema": { - "type": "string" - }, - "in": "query", - "required": true - }, - { - "name": "password", - "description": "The password for login in clear text", - "schema": { - "type": "string" - }, - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "headers": { - "X-Rate-Limit": { - "schema": { - "format": "int32", - "type": "integer" - }, - "description": "calls per hour allowed by the user" - }, - "X-Expires-After": { - "schema": { - "format": "date-time", - "type": "string" - }, - "description": "date in UTC when token expires" - } - }, - "content": { - "application/xml": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "type": "string" - } - } - }, - "description": "successful operation" - }, - "400": { - "description": "Invalid username/password supplied" - } - }, - "operationId": "loginUser", - "summary": "Logs user into the system", - "description": "" - } - }, - "/user/logout": { - "get": { - "tags": [ - "user" - ], - "responses": { - "default": { - "description": "successful operation" - } - }, - "operationId": "logoutUser", - "summary": "Logs out current logged in user session", - "description": "" - } - }, - "/user/{username}": { - "get": { - "tags": [ - "user" - ], - "parameters": [ - { - "name": "username", - "description": "The name that needs to be fetched. Use user1 for testing. ", - "schema": { - "type": "string" - }, - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "content": { - "application/xml": { - "schema": { - "$ref": "#/components/schemas/User" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - }, - "description": "successful operation" - }, - "400": { - "description": "Invalid username supplied" - }, - "404": { - "description": "User not found" - } - }, - "operationId": "getUserByName", - "summary": "Get user by user name", - "description": "" - }, - "put": { - "requestBody": { - "description": "Updated user object", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - }, - "required": true - }, - "tags": [ - "user" - ], - "parameters": [ - { - "name": "username", - "description": "name that need to be updated", - "schema": { - "type": "string" - }, - "in": "path", - "required": true - } - ], - "responses": { - "400": { - "description": "Invalid user supplied" - }, - "404": { - "description": "User not found" - } - }, - "operationId": "updateUser", - "summary": "Updated user", - "description": "This can only be done by the logged in user." - }, - "delete": { - "tags": [ - "user" - ], - "parameters": [ - { - "name": "username", - "description": "The name that needs to be deleted", - "schema": { - "type": "string" - }, - "in": "path", - "required": true - } - ], - "responses": { - "400": { - "description": "Invalid username supplied" - }, - "404": { - "description": "User not found" - } - }, - "operationId": "deleteUser", - "summary": "Delete user", - "description": "This can only be done by the logged in user." - } - } - }, - "components": { - "schemas": { - "Order": { - "type": "object", - "properties": { - "id": { - "format": "int64", - "type": "integer" - }, - "petId": { - "format": "int64", - "type": "integer" - }, - "quantity": { - "format": "int32", - "type": "integer" - }, - "shipDate": { - "format": "date-time", - "type": "string" - }, - "status": { - "description": "Order Status", - "enum": [ - "placed", - "approved", - "delivered" - ], - "type": "string" - }, - "complete": { - "default": false, - "type": "boolean" - } - }, - "xml": { - "name": "Order" - } - }, - "Category": { - "type": "object", - "properties": { - "id": { - "format": "int64", - "type": "integer" - }, - "name": { - "type": "string" - } - }, - "xml": { - "name": "Category" - } - }, - "User": { - "type": "object", - "properties": { - "id": { - "format": "int64", - "type": "integer" - }, - "username": { - "type": "string" - }, - "firstName": { - "type": "string" - }, - "lastName": { - "type": "string" - }, - "email": { - "type": "string" - }, - "password": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "userStatus": { - "format": "int32", - "description": "User Status", - "type": "integer" - } - }, - "xml": { - "name": "User" - } - }, - "Tag": { - "type": "object", - "properties": { - "id": { - "format": "int64", - "type": "integer" - }, - "name": { - "type": "string" - } - }, - "xml": { - "name": "Tag" - } - }, - "Pet": { - "required": [ - "name", - "photoUrls" - ], - "type": "object", - "properties": { - "id": { - "format": "int64", - "type": "integer" - }, - "category": { - "$ref": "#/components/schemas/Category" - }, - "name": { - "type": "string", - "example": "doggie" - }, - "photoUrls": { - "type": "array", - "items": { - "type": "string" - }, - "xml": { - "name": "photoUrl", - "wrapped": true - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Tag" - }, - "xml": { - "name": "tag", - "wrapped": true - } - }, - "status": { - "description": "pet status in the store", - "enum": [ - "available", - "pending", - "sold" - ], - "type": "string" - } - }, - "xml": { - "name": "Pet" - } - }, - "ApiResponse": { - "type": "object", - "properties": { - "code": { - "format": "int32", - "type": "integer" - }, - "type": { - "type": "string" - }, - "message": { - "type": "string" - } - } - } - }, - "securitySchemes": { - "petstore_auth": { - "flows": { - "implicit": { - "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", - "scopes": { - "write:pets": "modify pets in your account", - "read:pets": "read your pets" - } - } - }, - "type": "oauth2" - }, - "api_key": { - "type": "apiKey", - "name": "api_key", - "in": "header" - } - } - }, - "tags": [ - { - "name": "pet", - "description": "Everything about your Pets", - "externalDocs": { - "description": "Find out more", - "url": "http://swagger.io" - } - }, - { - "name": "store", - "description": "Access to Petstore orders" - }, - { - "name": "user", - "description": "Operations about user", - "externalDocs": { - "description": "Find out more about our store", - "url": "http://swagger.io" - } - } - ], - "externalDocs": { - "description": "Find out more about Swagger", - "url": "http://swagger.io" - } -} \ No newline at end of file diff --git a/karavan-demo/parceldemo/artemis/Dockerfile-adoptopenjdk-11 b/karavan-demo/parceldemo/artemis/Dockerfile-adoptopenjdk-11 deleted file mode 100644 index 499f8717..00000000 --- a/karavan-demo/parceldemo/artemis/Dockerfile-adoptopenjdk-11 +++ /dev/null @@ -1,69 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# ActiveMQ Artemis - -FROM adoptopenjdk:11-jre-hotspot -LABEL maintainer="Apache ActiveMQ Team" -# Make sure pipes are considered to determine success, see: https://github.com/hadolint/hadolint/wiki/DL4006 -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -WORKDIR /opt - -ENV ARTEMIS_USER artemis -ENV ARTEMIS_PASSWORD artemis -ENV ANONYMOUS_LOGIN false -ENV EXTRA_ARGS --http-host 0.0.0.0 --relax-jolokia - -# add user and group for artemis -RUN groupadd -g 1001 -r artemis && useradd -r -u 1001 -g artemis artemis \ - && apt-get -qq -o=Dpkg::Use-Pty=0 update && \ - apt-get -qq -o=Dpkg::Use-Pty=0 install -y libaio1 && \ - rm -rf /var/lib/apt/lists/* - -USER artemis - -ADD . /opt/activemq-artemis - -# Web Server -EXPOSE 8161 \ -# JMX Exporter - 9404 \ -# Port for CORE,MQTT,AMQP,HORNETQ,STOMP,OPENWIRE - 61616 \ -# Port for HORNETQ,STOMP - 5445 \ -# Port for AMQP - 5672 \ -# Port for MQTT - 1883 \ -#Port for STOMP - 61613 - -USER root - -RUN mkdir /var/lib/artemis-instance && chown -R artemis.artemis /var/lib/artemis-instance - -COPY ./docker/docker-run.sh / - -USER artemis - -# Expose some outstanding folders -VOLUME ["/var/lib/artemis-instance"] -WORKDIR /var/lib/artemis-instance - -ENTRYPOINT ["/docker-run.sh"] -CMD ["run"] diff --git a/karavan-demo/parceldemo/artemis/Dockerfile-centos b/karavan-demo/parceldemo/artemis/Dockerfile-centos deleted file mode 100644 index b6fe8f09..00000000 --- a/karavan-demo/parceldemo/artemis/Dockerfile-centos +++ /dev/null @@ -1,69 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# ActiveMQ Artemis - -FROM jboss/base-jdk:11 -LABEL maintainer="Apache ActiveMQ Team" -# Make sure pipes are considered to determine success, see: https://github.com/hadolint/hadolint/wiki/DL4006 -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -WORKDIR /opt - -ENV ARTEMIS_USER artemis -ENV ARTEMIS_PASSWORD artemis -ENV ANONYMOUS_LOGIN false -ENV EXTRA_ARGS --http-host 0.0.0.0 --relax-jolokia - -USER root - -# add user and group for artemis -RUN groupadd -g 1001 -r artemis && useradd -r -u 1001 -g artemis artemis \ - && yum install -y libaio && yum -y clean all - -USER artemis - -ADD . /opt/activemq-artemis - -# Web Server -EXPOSE 8161 \ -# JMX Exporter - 9404 \ -# Port for CORE,MQTT,AMQP,HORNETQ,STOMP,OPENWIRE - 61616 \ -# Port for HORNETQ,STOMP - 5445 \ -# Port for AMQP - 5672 \ -# Port for MQTT - 1883 \ -#Port for STOMP - 61613 - -USER root - -RUN mkdir /var/lib/artemis-instance && chown -R artemis.artemis /var/lib/artemis-instance - -COPY ./docker/docker-run.sh / - -USER artemis - -# Expose some outstanding folders -VOLUME ["/var/lib/artemis-instance"] -WORKDIR /var/lib/artemis-instance - -ENTRYPOINT ["/docker-run.sh"] -CMD ["run"] \ No newline at end of file diff --git a/karavan-demo/parceldemo/artemis/Dockerfile-debian b/karavan-demo/parceldemo/artemis/Dockerfile-debian deleted file mode 100644 index 263dbb3a..00000000 --- a/karavan-demo/parceldemo/artemis/Dockerfile-debian +++ /dev/null @@ -1,69 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# ActiveMQ Artemis - -FROM openjdk:11 -LABEL maintainer="Apache ActiveMQ Team" -# Make sure pipes are considered to determine success, see: https://github.com/hadolint/hadolint/wiki/DL4006 -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -WORKDIR /opt - -ENV ARTEMIS_USER artemis -ENV ARTEMIS_PASSWORD artemis -ENV ANONYMOUS_LOGIN false -ENV EXTRA_ARGS --http-host 0.0.0.0 --relax-jolokia - -# add user and group for artemis -RUN groupadd -g 1001 -r artemis && useradd -r -u 1001 -g artemis artemis \ - && apt-get -qq -o=Dpkg::Use-Pty=0 update && \ - apt-get -qq -o=Dpkg::Use-Pty=0 install -y libaio1 && \ - rm -rf /var/lib/apt/lists/* - -USER artemis - -ADD . /opt/activemq-artemis - -# Web Server -EXPOSE 8161 \ -# JMX Exporter - 9404 \ -# Port for CORE,MQTT,AMQP,HORNETQ,STOMP,OPENWIRE - 61616 \ -# Port for HORNETQ,STOMP - 5445 \ -# Port for AMQP - 5672 \ -# Port for MQTT - 1883 \ -#Port for STOMP - 61613 - -USER root - -RUN mkdir /var/lib/artemis-instance && chown -R artemis.artemis /var/lib/artemis-instance - -COPY ./docker/docker-run.sh / - -USER artemis - -# Expose some outstanding folders -VOLUME ["/var/lib/artemis-instance"] -WORKDIR /var/lib/artemis-instance - -ENTRYPOINT ["/docker-run.sh"] -CMD ["run"] diff --git a/karavan-demo/parceldemo/artemis/docker-run.sh b/karavan-demo/parceldemo/artemis/docker-run.sh deleted file mode 100755 index ba7ee681..00000000 --- a/karavan-demo/parceldemo/artemis/docker-run.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - - -# This is the entry point for the docker images. -# This file is executed when docker run is called. - - -set -e - -BROKER_HOME=/var/lib/ -CONFIG_PATH=$BROKER_HOME/etc -export BROKER_HOME OVERRIDE_PATH CONFIG_PATH - -if [[ ${ANONYMOUS_LOGIN,,} == "true" ]]; then - LOGIN_OPTION="--allow-anonymous" -else - LOGIN_OPTION="--require-login" -fi - -CREATE_ARGUMENTS="--user ${ARTEMIS_USER} --password ${ARTEMIS_PASSWORD} --silent ${LOGIN_OPTION} ${EXTRA_ARGS}" - -echo CREATE_ARGUMENTS=${CREATE_ARGUMENTS} - -if ! [ -f ./etc/broker.xml ]; then - /opt/activemq-artemis/bin/artemis create ${CREATE_ARGUMENTS} . -else - echo "broker already created, ignoring creation" -fi - -exec ./bin/artemis "$@" - - diff --git a/karavan-demo/parceldemo/artemis/prepare-docker.sh b/karavan-demo/parceldemo/artemis/prepare-docker.sh deleted file mode 100755 index f14717ca..00000000 --- a/karavan-demo/parceldemo/artemis/prepare-docker.sh +++ /dev/null @@ -1,184 +0,0 @@ -#!/bin/sh -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Setting the script to fail if anything goes wrong -set -e - -#This is a script to Prepare an artemis folder to generate the Release. - - -usage () { - cat <<HERE - -$@ - -Usage: - # Prepare for build the Docker Image from the local distribution - ./prepare-docker.sh --from-local-dist --local-dist-path {local-distribution-directory} - - # Prepare for build the Docker Image from the release version - ./prepare-docker.sh --from-release --artemis-version {release-version} - - # Show the usage command - ./prepare-docker.sh --help - -Example: - ./prepare-docker.sh --from-local-dist --local-dist-path ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT - ./prepare-docker.sh --from-release --artemis-version 2.16.0 - -HERE - exit 1 -} - -next_step () { - cat <<HERE - -Well done! Now you can continue with the Docker image build. -Building the Docker Image: - Go to $ARTEMIS_DIST where you prepared the binary with Docker files. - - # Go to $ARTEMIS_DIST - $ cd $ARTEMIS_DIST - - # For Debian - $ docker build -f ./docker/Dockerfile-debian -t artemis-debian . - - # For CentOS - $ docker build -f ./docker/Dockerfile-centos -t artemis-centos . - - # For AdoptOpen JDK 11 - $ docker build -f ./docker/Dockerfile-adoptopenjdk-11 -t artemis-adoptopenjdk-11 . - - # For AdoptOpen JDK 11 (Build for linux ARMv7/ARM64) - $ docker buildx build --platform linux/arm64,linux/arm/v7 --push -t {your-repository}/apache-artemis:2.17.0-SNAPSHOT -f ./docker/Dockerfile-adoptopenjdk-11 . - -Note: -t artemis-debian, -t artemis-centos and artemis-adoptopenjdk-11 are just -tag names for the purpose of this guide - -For more info read the readme.md - -HERE - exit 0 -} - -while [ "$#" -ge 1 ] -do -key="$1" - case $key in - --help) - usage - ;; - --from-local-dist) - FROM_LOCAL="true" - ;; - --from-release) - FROM_RELEASE="true" - ;; - --local-dist-path) - LOCAL_DIST_PATH="$2" - shift - ;; - --artemis-version) - ARTEMIS_VERSION="$2" - shift - ;; - *) - # unknown option - usage "Unknown option" - ;; - esac - shift -done - -# TMPDIR must be contained within the working directory so it is part of the -# Docker context. (i.e. it can't be mktemp'd in /tmp) -BASE_TMPDIR="_TMP_/artemis" - -cleanup() { - if [ -d "${BASE_TMPDIR}/${ARTEMIS_VERSION}" ] - then - echo "Clean up the ${BASE_TMPDIR}/${ARTEMIS_VERSION} directory" - find "${BASE_TMPDIR}" -name "${ARTEMIS_VERSION}" -type d -mmin +60 -exec rm -rf "{}" \; - else - mkdir -p "${BASE_TMPDIR}/${ARTEMIS_VERSION}" - fi -} - -if [ -n "${FROM_RELEASE}" ]; then - [ -n "${ARTEMIS_VERSION}" ] || usage "You must specify the release version (es.: --artemis-version 2.16.0)" - - cleanup - - ARTEMIS_BASE_URL="$(curl -s https://www.apache.org/dyn/closer.cgi\?preferred=true)activemq/activemq-artemis/${ARTEMIS_VERSION}/" - ARTEMIS_DIST_FILE_NAME="apache-artemis-${ARTEMIS_VERSION}-bin.tar.gz" - CURL_OUTPUT="${BASE_TMPDIR}/${ARTEMIS_VERSION}/${ARTEMIS_DIST_FILE_NAME}" - - if [ -z "$(ls -A ${BASE_TMPDIR}/${ARTEMIS_VERSION})" ] - then - echo "Downloading ${ARTEMIS_DIST_FILE_NAME} from ${ARTEMIS_BASE_URL}..." - curl --progress-bar "${ARTEMIS_BASE_URL}${ARTEMIS_DIST_FILE_NAME}" --output "${CURL_OUTPUT}" - - echo "Expanding ${BASE_TMPDIR}/${ARTEMIS_VERSION}/${ARTEMIS_DIST_FILE_NAME}..." - tar xzf "$CURL_OUTPUT" --directory "${BASE_TMPDIR}/${ARTEMIS_VERSION}" --strip 1 - - echo "Removing ${BASE_TMPDIR}/${ARTEMIS_VERSION}/${ARTEMIS_DIST_FILE_NAME}..." - rm -rf "${BASE_TMPDIR}/${ARTEMIS_VERSION}"/"${ARTEMIS_DIST_FILE_NAME}" - fi - - ARTEMIS_DIST="${BASE_TMPDIR}/${ARTEMIS_VERSION}" - - echo "Using Artemis dist: ${ARTEMIS_DIST}" - -elif [ -n "${FROM_LOCAL}" ]; then - - if [ -n "${LOCAL_DIST_PATH}" ]; then - ARTEMIS_DIST=${LOCAL_DIST_PATH} - echo "Using Artemis dist: ${ARTEMIS_DIST}" - else - usage "You must specify the local distribution directory" - fi - - if [ ! -d "${ARTEMIS_DIST}" ] - then - usage "Directory ${ARTEMIS_DIST} does not exist" - fi - - if [ -d "${ARTEMIS_DIST}/docker" ] - then - echo "Clean up the ${ARTEMIS_DIST}/docker directory" - rm -rf "${ARTEMIS_DIST}/docker" - fi - -else - - usage - -fi - -if [ ! -d "${ARTEMIS_DIST}/docker" ] -then - mkdir "${ARTEMIS_DIST}/docker" -fi - -cp ./Dockerfile-* "$ARTEMIS_DIST/docker" -cp ./docker-run.sh "$ARTEMIS_DIST/docker" - -echo "Docker file support files at : $ARTEMIS_DIST/docker" -tree "$ARTEMIS_DIST/docker" - -next_step \ No newline at end of file diff --git a/karavan-demo/parceldemo/artemis/readme.md b/karavan-demo/parceldemo/artemis/readme.md deleted file mode 100644 index 3f17743d..00000000 --- a/karavan-demo/parceldemo/artemis/readme.md +++ /dev/null @@ -1,198 +0,0 @@ -# Docker Image Example - -This is an example on how you could create your own Docker Image For Apache -ActiveMQ Artemis based on CentOS or Debian (JDK 8) or AdoptOpen JDK 11 (Ubuntu). - -# Preparing - -Use the script ./prepare-docker.sh as it will copy the docker files under the -binary distribution. - -Below is shown the command to prepare the build of the Docker Image starting -from the local distribution (from the source codes of ActiveMQ Artemis) -``` -# Prepare for build the Docker Image from the local distribution. Replace the -# {local-distribution-directory} with your directory. -$ ./prepare-docker.sh --from-local-dist --local-dist-path {local-distribution-directory} -``` - -The output of the previous command is shown below. - -``` -$ ./prepare-docker.sh --from-local-dist --local-dist-path ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT - -Using Artemis dist: ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT -Clean up the ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT/docker directory -Docker file support files at : ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT/docker -../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT/docker -├── Dockerfile-adoptopenjdk-11 -├── Dockerfile-centos -├── Dockerfile-debian -└── docker-run.sh - -0 directories, 4 files - -Well done! Now you can continue with the Docker image build. -Building the Docker Image: - Go to ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT where you prepared the binary with Docker files. - - # Go to ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT - $ cd ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT - - # For Debian - $ docker build -f ./docker/Dockerfile-debian -t artemis-debian . - - # For CentOS - $ docker build -f ./docker/Dockerfile-centos -t artemis-centos . - - # For AdoptOpen JDK 11 - $ docker build -f ./docker/Dockerfile-adoptopenjdk-11 -t artemis-adoptopenjdk-11 . - -Note: -t artemis-debian, -t artemis-centos and artemis-adoptopenjdk-11 are just -tag names for the purpose of this guide - -For more info read the readme.md - -``` - -The command to prepare the build of the Docker Image starting from the official -release of ActiveMQ Artemis is shown below -``` -# Prepare for build the Docker Image from the release version. Replace the -# {release-version} with the version that you want -$ ./prepare-docker.sh --from-release --artemis-version {release-version} -``` - -The output of the previous command is shown below. - -``` -$ ./prepare-docker.sh --from-release --artemis-version 2.16.0 - -Downloading apache-artemis-2.16.0-bin.tar.gz from https://downloads.apache.org/activemq/activemq-artemis/2.16.0/... -################################################################################################################################################################################################################################ 100,0% -Expanding _TMP_/artemis/2.16.0/apache-artemis-2.16.0-bin.tar.gz... -Removing _TMP_/artemis/2.16.0/apache-artemis-2.16.0-bin.tar.gz... -Using Artemis dist: _TMP_/artemis/2.16.0 -Docker file support files at : _TMP_/artemis/2.16.0/docker -_TMP_/artemis/2.16.0/docker -├── Dockerfile-adoptopenjdk-11 -├── Dockerfile-centos -├── Dockerfile-debian -└── docker-run.sh - -0 directories, 4 files - -Well done! Now you can continue with the Docker image build. -Building the Docker Image: - Go to _TMP_/artemis/2.16.0 where you prepared the binary with Docker files. - - # Go to _TMP_/artemis/2.16.0 - $ cd _TMP_/artemis/2.16.0 - - # For Debian - $ docker build -f ./docker/Dockerfile-debian -t artemis-debian . - - # For CentOS - $ docker build -f ./docker/Dockerfile-centos -t artemis-centos . - - # For AdoptOpen JDK 11 - $ docker build -f ./docker/Dockerfile-adoptopenjdk-11 -t artemis-adoptopenjdk-11 . - -Note: -t artemis-debian, -t artemis-centos and artemis-adoptopenjdk-11 are just -tag names for the purpose of this guide - -For more info read the readme.md -``` - -# Building - -Go to `$ARTEMIS_DIST` where you prepared the binary with Docker files. - -## For Debian - -From within the `$ARTEMIS_DIST` folder: -``` -$ docker build -f ./docker/Dockerfile-debian -t artemis-debian . -``` - -## For CentOS - -From within the `$ARTEMIS_DIST` folder: -``` -$ docker build -f ./docker/Dockerfile-centos -t artemis-centos . -``` - -## For AdoptOpen JDK 11 -From within the `$ARTEMIS_DIST` folder: -``` -$ docker build -f ./docker/Dockerfile-adoptopenjdk-11 -t artemis-adoptopenjdk-11 . -``` - -# For AdoptOpen JDK 11 (Build for linux ARMv7/ARM64) -``` -$ docker buildx build --platform linux/arm64,linux/arm/v7 --push -t {your-repository}/apache-artemis:2.17.0-SNAPSHOT -f ./docker/Dockerfile-adoptopenjdk-11 . -``` - -**Note:** -`-t artemis-debian`,`-t artemis-centos`,`artemis-adoptopenjdk-11` are just tag -names for the purpose of this guide - - -# Environment Variables - -Environment variables determine the options sent to `artemis create` on first execution of the Docker -container. The available options are: - -**`ARTEMIS_USER`** - -The administrator username. The default is `artemis`. - -**`ARTEMIS_PASSWORD`** - -The administrator password. The default is `artemis`. - -**`ANONYMOUS_LOGIN`** - -Set to `true` to allow anonymous logins. The default is `false`. - -**`EXTRA_ARGS`** - -Additional arguments sent to the `artemis create` command. The default is `--http-host 0.0.0.0 --relax-jolokia`. -Setting this value will override the default. See the documentation on `artemis create` for available options. - -**Final broker creation command:** - -The combination of the above environment variables results in the `docker-run.sh` script calling -the following command to create the broker instance the first time the Docker container runs: - - ${ARTEMIS_HOME}/bin/artemis create --user ${ARTEMIS_USER} --password ${ARTEMIS_PASSWORD} --silent ${LOGIN_OPTION} ${EXTRA_ARGS} - -Note: `LOGIN_OPTION` is either `--allow-anonymous` or `--require-login` depending on the value of `ANONYMOUS_LOGIN`. - -# Mapping point - -- `/var/lib/artemis-instance` - -It's possible to map a folder as the instance broker. -This will hold the configuration and the data of the running broker. This is useful for when you want the data persisted outside of a container. - - -# Lifecycle of the execution - -A broker instance will be created during the execution of the instance. If you pass a mapped folder for `/var/lib/artemis-instance` an image will be created or reused depending on the contents of the folder. - - - -## Running a CentOS image - -The image just created in the previous step allows both stateless or stateful runs. -The stateless run is achieved by: -``` -$ docker run --rm -it -p 61616:61616 -p 8161:8161 artemis-centos -``` -The image will also support mapped folders and mapped ports. To run the image with the instance persisted on the host: -``` -docker run -it -p 61616:61616 -p 8161:8161 -v <broker folder on host>:/var/lib/artemis-instance artemis-centos -``` -where `<broker folder on host>` is a folder where the broker instance is supposed to -be saved and reused on each run. diff --git a/karavan-demo/parceldemo/docker-compose/docker-compose.yaml b/karavan-demo/parceldemo/docker-compose/docker-compose.yaml deleted file mode 100644 index 6bedcc2f..00000000 --- a/karavan-demo/parceldemo/docker-compose/docker-compose.yaml +++ /dev/null @@ -1,64 +0,0 @@ ---- -version: '3.8' -services: - - zookeeper: - container_name: zookeeper - image: confluentinc/cp-zookeeper:latest - ports: - - "2181:2181" - environment: - ZOOKEEPER_CLIENT_PORT: 2181 - ZOOKEEPER_TICK_TIME: 2000 - - kafka: - container_name: kafka - image: confluentinc/cp-kafka:latest - depends_on: - - zookeeper - ports: - - "9092:9092" - environment: - KAFKA_BROKER_ID: 1 - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT - KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - KAFKA_CREATE_TOPICS: "events:1:1" - - artemis: - image: artemis-adoptopenjdk-11:latest - container_name: artemis - environment: - - ARTEMIS_USER=admin - - ARTEMIS_PASSWORD=admin - - ANONYMOUS_LOGIN=true - ports: - - "61616:61616" - - "1883:1883" - - "8161:8161" - - postgres: - image: postgres - container_name: postgres - restart: always - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - - POSTGRES_DB=demo - ports: - - '5432:5432' - volumes: - - ./postgres_db.sql:/docker-entrypoint-initdb.d/postgres_db.sql - command: 'postgres --max_prepared_transactions=100' - - pgadmin: - container_name: pgadmin - image: dpage/pgadmin4 - restart: always - environment: - PGADMIN_DEFAULT_EMAIL: ad...@admin.com - PGADMIN_DEFAULT_PASSWORD: root - ports: - - "5050:80" diff --git a/karavan-demo/parceldemo/docker-compose/postgres_db.sql b/karavan-demo/parceldemo/docker-compose/postgres_db.sql deleted file mode 100644 index 92a7bbb2..00000000 --- a/karavan-demo/parceldemo/docker-compose/postgres_db.sql +++ /dev/null @@ -1,6 +0,0 @@ -CREATE TABLE IF NOT EXISTS parcels ( - id varchar(250) NOT NULL, - address varchar(250) NOT NULL, - status varchar(250), - PRIMARY KEY (id) -); diff --git a/karavan-demo/parceldemo/docker-compose/start.sh b/karavan-demo/parceldemo/docker-compose/start.sh deleted file mode 100755 index ccb09e38..00000000 --- a/karavan-demo/parceldemo/docker-compose/start.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -docker-compose down -docker rm -f $(docker ps -a -q) -docker volume rm $(docker volume ls -q) -docker-compose up -d -docker-compose logs -f \ No newline at end of file diff --git a/karavan-demo/parceldemo/docs/README.md b/karavan-demo/parceldemo/docs/README.md deleted file mode 100644 index c456cdcb..00000000 --- a/karavan-demo/parceldemo/docs/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# Demo: Parcels Delivery Service - - - -## Localhost -### Prerequisites - -1. [VSCode](https://code.visualstudio.com/download) installed -2. Apache Camel [Karavan](https://marketplace.visualstudio.com/items?itemName=camel-karavan.karavan) extension installed -3. [JBang](https://www.jbang.dev/download/) installed -4. Docker and Docker compose installed -5. Build Apache Artemis Docker Image -``` -cd ../artemis -./prepare-docker.sh --from-release --artemis-version 2.22.0 -cd _TMP_/artemis/2.22.0 -docker build -f ./docker/Dockerfile-adoptopenjdk-11 -t artemis-adoptopenjdk-11 . -``` -For MacOS users, in case of `tree command not found` error, install tree `brew install tree` - -### Start environment -``` -cd docker-compose -docker-compose up -``` - -### Start integration -``` -jbang -Dcamel.jbang.version=3.18.1 camel@apache/camel run * -``` - -### Publish parcel -``` -curl -X POST -H "Content-Type: application/json" --data '{"id":"1","address":"666 Sin Street, Holy City"}' http://0.0.0.0:8080/parcels -``` - -### Publish payment -Open AMQ7 Broker Management [Console](http://localhost:8161) - -Send message to `payments` queue -``` -<?xml version="1.0" encoding="UTF-8" ?> -<root> - <id>1</id> - <amount>777</amount> - <status>confirmed</status> -</root> -``` - -## OpenShift -## Prerequisites - -1. [VSCode](https://code.visualstudio.com/download) installed -2. Apache Camel [Karavan](https://marketplace.visualstudio.com/items?itemName=camel-karavan.karavan) extension installed -3. [JBang](https://www.jbang.dev/download/) installed -4. OpenShift 4.9+ cluster up and running -5. OpenShift 4.9+ CLI installed -6. Apache Camel Karavan installed in OpenShift - - -### Install AMQ and AMQ Streams Operators -Also creates `karavan` namespace required for the demo -``` -cd ../openshift-manifests -oc login --token=... --server=... -oc apply -k operators -``` -Check that operators are succesfully installed - - -### Create AMQ, Kafka and Postgres demo instances -``` -oc apply -k instances -n karavan -``` - -### Package, build and deploy project -1. Open Karavan Application -2. Create project Parceldemo -3. Create integration parceldemo -4. Replace integration code with [parceldemo.yaml](project/parceldemo.yaml) -5. Set Kamelets configuration according their services in Openshift -6. Click `Run` button - - -### Publish parcel -``` -appsurl=$(oc get ingresses.config.openshift.io cluster -o template --template '{{.spec.domain}}') - -curl -X POST -H "Content-Type: application/json" --data '{"id":"1","address":"666 Sin Street, Holy City"}' http://parceldemo-karavan.$appsurl/parcels -``` -### Publish payment -Open AMQ7 Broker Management -``` -open http://console-parceldemo.$appsurl -``` - -Send message to `payments` queue -``` -<?xml version="1.0" encoding="UTF-8" ?> -<root> - <id>1</id> - <amount>777</amount> - <status>confirmed</status> -</root> -``` - -### Check parceldemo logs and Database diff --git a/karavan-demo/parceldemo/docs/operators.png b/karavan-demo/parceldemo/docs/operators.png deleted file mode 100644 index 3582bcb9..00000000 Binary files a/karavan-demo/parceldemo/docs/operators.png and /dev/null differ diff --git a/karavan-demo/parceldemo/docs/parcels.png b/karavan-demo/parceldemo/docs/parcels.png deleted file mode 100644 index 3cb70ffb..00000000 Binary files a/karavan-demo/parceldemo/docs/parcels.png and /dev/null differ diff --git a/karavan-demo/parceldemo/openshift-manifests/instances/amq-broker.yaml b/karavan-demo/parceldemo/openshift-manifests/instances/amq-broker.yaml deleted file mode 100644 index 4d5b0acc..00000000 --- a/karavan-demo/parceldemo/openshift-manifests/instances/amq-broker.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: broker.amq.io/v1beta1 -kind: ActiveMQArtemis -metadata: - name: amq - application: amq -spec: - acceptors: - - port: 61616 - expose: true - name: all - protocols: all - anycastPrefix: jms.queue. - verifyHost: false - sslEnabled: false - - port: 1883 - expose: true - name: mqtt - protocols: mqtt - anycastPrefix: jms.queue. - verifyHost: false - sslEnabled: false - adminPassword: admin - deploymentPlan: - size: 1 - persistenceEnabled: true - requireLogin: false - messageMigration: false - managementRBACEnabled: true - journalType: nio - jolokiaAgentEnabled: false - image: placeholder - console: - expose: true - adminUser: admin - ---- -kind: Route -apiVersion: route.openshift.io/v1 -metadata: - name: console -spec: - to: - kind: Service - name: amq-hdls-svc - weight: 100 - port: - targetPort: console-jolokia - wildcardPolicy: None diff --git a/karavan-demo/parceldemo/openshift-manifests/instances/amq-streams.yaml b/karavan-demo/parceldemo/openshift-manifests/instances/amq-streams.yaml deleted file mode 100644 index be6dda89..00000000 --- a/karavan-demo/parceldemo/openshift-manifests/instances/amq-streams.yaml +++ /dev/null @@ -1,33 +0,0 @@ -kind: Kafka -apiVersion: kafka.strimzi.io/v1beta2 -metadata: - name: kafka -spec: - kafka: - version: 3.1.0 - replicas: 1 - listeners: - - name: plain - port: 9092 - type: internal - tls: false - - name: tls - port: 9093 - type: internal - tls: true - config: - offsets.topic.replication.factor: 1 - transaction.state.log.replication.factor: 1 - transaction.state.log.min.isr: 1 - default.replication.factor: 1 - min.insync.replicas: 1 - inter.broker.protocol.version: '3.1' - storage: - type: ephemeral - zookeeper: - replicas: 1 - storage: - type: ephemeral - entityOperator: - topicOperator: {} - userOperator: {} \ No newline at end of file diff --git a/karavan-demo/parceldemo/openshift-manifests/instances/kustomization.yaml b/karavan-demo/parceldemo/openshift-manifests/instances/kustomization.yaml deleted file mode 100644 index 70b1557a..00000000 --- a/karavan-demo/parceldemo/openshift-manifests/instances/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- postgresql.yaml -- amq-broker.yaml -- amq-streams.yaml \ No newline at end of file diff --git a/karavan-demo/parceldemo/openshift-manifests/instances/postgresql.yaml b/karavan-demo/parceldemo/openshift-manifests/instances/postgresql.yaml deleted file mode 100644 index caed3823..00000000 --- a/karavan-demo/parceldemo/openshift-manifests/instances/postgresql.yaml +++ /dev/null @@ -1,168 +0,0 @@ -apiVersion: apps.openshift.io/v1 -kind: DeploymentConfig -metadata: - labels: - app: postgres - app.kubernetes.io/component: postgres-dc - app.kubernetes.io/instance: postgres - app.kubernetes.io/part-of: postgres - app.openshift.io/runtime: postgres - deploymentconfig: postgres - name: postgres - annotations: - argocd.argoproj.io/sync-options: Validate=false -spec: - replicas: 1 - revisionHistoryLimit: 3 - selector: - name: postgres - app: postgres - deploymentconfig: postgres - strategy: - activeDeadlineSeconds: 21600 - recreateParams: - timeoutSeconds: 600 - resources: {} - type: Recreate - template: - metadata: - name: postgres - labels: - app: postgres - name: postgres - deploymentconfig: postgres - spec: - containers: - - env: - - name: POSTGRESQL_USER - value: postgres - - name: POSTGRESQL_PASSWORD - value: postgres - - name: POSTGRESQL_DATABASE - value: demo - imagePullPolicy: IfNotPresent - lifecycle: - postStart: - exec: - command: - - /bin/sh - - -c - - /var/lib/pgsql/demo/postStart.sh - # postStart: - # exec: - # command: - # - sleep 10 && echo ${SQL_TABLE} | psql -U ${POSTGRESQL_USER} -d ${POSTGRESQL_DATABASE}; - # - sleep 10 && echo ${SQL_DB} | psql -U ${POSTGRESQL_USER} && echo ${SQL_TABLE} | psql -U ${POSTGRESQL_USER} -d ${POSTGRESQL_DATABASE}; - failureThreshold: 3 - initialDelaySeconds: 30 - periodSeconds: 10 - successThreshold: 1 - tcpSocket: - port: 5432 - timeoutSeconds: 1 - name: postgresql - ports: - - containerPort: 5432 - protocol: TCP - readinessProbe: - exec: - command: - - /bin/sh - - -i - - -c - - psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c 'SELECT 1' - failureThreshold: 3 - initialDelaySeconds: 5 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 - resources: - limits: - cpu: '1' - memory: 512Mi - requests: - cpu: 250m - memory: 256Mi - securityContext: - capabilities: {} - privileged: false - procMount: Default - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - volumeMounts: - - mountPath: /var/lib/pgsql/data - name: postgres-data - - mountPath: /var/lib/pgsql/demo - name: postgres-config - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - volumes: - - name: postgres-data - emptyDir: {} - - configMap: - defaultMode: 511 - name: postgres-config - name: postgres-config - test: false - triggers: - - imageChangeParams: - automatic: true - containerNames: - - postgresql - from: - kind: ImageStreamTag - name: postgresql:latest - namespace: openshift - type: ImageChange - - type: ConfigChange ---- -apiVersion: v1 -kind: ConfigMap -metadata: - labels: - app: postgres - component: postgres - name: postgres-config -data: - add-sample-db.sh: | - #!/bin/bash - until bash -c "psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -c 'SELECT 1'"; do - echo "Waiting for Postgres server..." - sleep 1 - done - echo "----- creating sampledb" - psql <<EOF - CREATE DATABASE demo OWNER postgres; - EOF - psql -d demo -U postgres <<'EOF' - CREATE TABLE IF NOT EXISTS parcels (id varchar(250) NOT NULL, address varchar(250) NOT NULL, status varchar(250), PRIMARY KEY (id)); - EOF - postStart.sh: | - #!/bin/bash - /var/lib/pgsql/demo/add-sample-db.sh &> /proc/1/fd/1 ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: postgres - app.kubernetes.io/component: postgres-svc - app.kubernetes.io/instance: postgres - app.kubernetes.io/part-of: postgres - name: postgres -spec: - ports: - - name: postgresql - port: 5432 - protocol: TCP - targetPort: 5432 - selector: - app: postgres - deploymentconfig: postgres - sessionAffinity: None - type: ClusterIP -status: - loadBalancer: {} diff --git a/karavan-demo/parceldemo/openshift-manifests/operators/amq-operator.yaml b/karavan-demo/parceldemo/openshift-manifests/operators/amq-operator.yaml deleted file mode 100644 index d83442f9..00000000 --- a/karavan-demo/parceldemo/openshift-manifests/operators/amq-operator.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: amq-broker-rhel8 - namespace: openshift-operators -spec: - channel: 7.x - installPlanApproval: Automatic - name: amq-broker-rhel8 - source: redhat-operators - sourceNamespace: openshift-marketplace diff --git a/karavan-demo/parceldemo/openshift-manifests/operators/amq-streams-operator.yaml b/karavan-demo/parceldemo/openshift-manifests/operators/amq-streams-operator.yaml deleted file mode 100644 index b9109c3d..00000000 --- a/karavan-demo/parceldemo/openshift-manifests/operators/amq-streams-operator.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - labels: - operators.coreos.com/amq-streams.openshift-operators: "" - name: amq-streams - namespace: openshift-operators -spec: - channel: stable - installPlanApproval: Automatic - name: amq-streams - source: redhat-operators - sourceNamespace: openshift-marketplace \ No newline at end of file diff --git a/karavan-demo/parceldemo/openshift-manifests/operators/kustomization.yaml b/karavan-demo/parceldemo/openshift-manifests/operators/kustomization.yaml deleted file mode 100644 index 28eb2649..00000000 --- a/karavan-demo/parceldemo/openshift-manifests/operators/kustomization.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - operator-group.yaml - - amq-operator.yaml - - amq-streams-operator.yaml diff --git a/karavan-demo/parceldemo/openshift-manifests/operators/operator-group.yaml b/karavan-demo/parceldemo/openshift-manifests/operators/operator-group.yaml deleted file mode 100644 index fbbcc6c0..00000000 --- a/karavan-demo/parceldemo/openshift-manifests/operators/operator-group.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: karavan -spec: - targetNamespaces: - - karavan diff --git a/karavan-demo/parceldemo/project/application.properties b/karavan-demo/parceldemo/project/application.properties deleted file mode 100644 index 673df052..00000000 --- a/karavan-demo/parceldemo/project/application.properties +++ /dev/null @@ -1,15 +0,0 @@ -camel.jbang.project-id=parceldemo -camel.jbang.project-name=parceldemo -camel.jbang.project-description=parceldemo -camel.jbang.gav=org.camel.karavan.demo:parceldemo:1.0.0 -camel.jbang.runtime=quarkus -camel.jbang.quarkusVersion=2.16.7.Final -camel.jbang.dependencies=camel:microprofile-health,mvn:io.quarkus:quarkus-container-image-jib,mvn:io.quarkus:quarkus-openshift -camel.health.enabled=true -camel.health.exposure-level=full -quarkus.kubernetes-client.trust-certs=true -quarkus.container-image.group=karavan -quarkus.container-image.name=parceldemo -quarkus.openshift.route.expose=false -quarkus.openshift.part-of=parceldemo -quarkus.openshift.replicas=1 \ No newline at end of file diff --git a/karavan-demo/parceldemo/project/parceldemo.yaml b/karavan-demo/parceldemo/project/parceldemo.yaml deleted file mode 100644 index 44b0c4e2..00000000 --- a/karavan-demo/parceldemo/project/parceldemo.yaml +++ /dev/null @@ -1,133 +0,0 @@ -apiVersion: camel.apache.org/v1 -kind: Integration -metadata: - name: parceldemo -spec: - flows: - - rest: - post: - - to: direct:post - path: /parcels - consumes: application/json - produces: application/json - - route: - from: - uri: direct:post - steps: - - log: - message: 'Received: ${body}' - - multicast: - steps: - - to: - uri: kamelet:kafka-not-secured-sink - parameters: - topic: parcels - bootstrapServers: localhost:9092 - - to: - uri: kamelet:postgresql-sink - parameters: - serverName: localhost - serverPort: '5432' - username: postgres - password: postgres - databaseName: demo - query: >- - INSERT INTO parcels (id,address) VALUES - (:#id,:#address) ON CONFLICT (id) DO NOTHING - aggregationStrategy: >- - #class:org.apache.camel.processor.aggregate.UseOriginalAggregationStrategy - parallelProcessing: true - streaming: true - id: post - - route: - from: - uri: kamelet:jms-apache-artemis-source - steps: - - to: - uri: xj:identity - parameters: - transformDirection: XML2JSON - - to: - uri: kamelet:kafka-not-secured-sink - parameters: - topic: payments - bootstrapServers: localhost:9092 - parameters: - destinationType: queue - destinationName: payments - brokerURL: tcp://localhost:61616 - id: payment - - route: - from: - uri: kamelet:kafka-not-secured-source - steps: - - log: - message: 'Aggegating: ${body}' - - unmarshal: - json: - library: jackson - - aggregate: - steps: - - choice: - when: - - expression: - groovy: - expression: >- - body.find { it.containsKey('status') }.status == - 'confirmed' - steps: - - marshal: - json: - library: jackson - - log: - message: 'Send to MQTT : ${body}' - - to: - uri: kamelet:mqtt-sink - parameters: - topic: deliveries - brokerUrl: tcp://localhost:1883 - otherwise: - steps: - - setBody: - expression: - groovy: - expression: 'body.find { it.containsKey(''status'') } ' - - marshal: - json: - library: jackson - - log: - message: 'Send to database: ${body}' - - to: - uri: kamelet:postgresql-sink - parameters: - serverName: localhost - serverPort: '5432' - username: postgres - password: postgres - databaseName: demo - query: >- - UPDATE parcels set status = 'CANCELED' WHERE - id = :#id - aggregationStrategy: aggregator - completionSize: 2 - correlationExpression: - groovy: - expression: body.get('id') - parameters: - topic: parcels,payments - bootstrapServers: localhost:9092 - autoCommitEnable: true - consumerGroup: parceldemo - id: aggregator - - route: - from: - uri: kamelet:mqtt-source - steps: - - log: - message: 'Delivery: ${body}' - parameters: - topic: deliveries - brokerUrl: tcp://localhost:1883 - - beans: - - name: aggregator - type: org.apache.camel.processor.aggregate.GroupedBodyAggregationStrategy diff --git a/karavan-demo/placeholder/application.properties b/karavan-demo/placeholder/application.properties deleted file mode 100644 index 8480f5f0..00000000 --- a/karavan-demo/placeholder/application.properties +++ /dev/null @@ -1,33 +0,0 @@ -message=Hello Placeholder! -camel.jbang.project.name=demo -camel.jbang.project.version=1.0.0 -camel.jbang.project.namespace=default -camel.jbang.project.cleanup=false -camel.jbang.package=true -camel.jbang.package.uber-jar.jar=camel-runner.jar -camel.jbang.package.uber-jar.fresh=true -camel.main.routesIncludePattern=file:demo.yaml -camel.jbang.build.image=true -camel.jbang.build.image.openshift=false -camel.jbang.build.image.build-config=false -camel.jbang.build.image.push=false -camel.jbang.build.image.jar=camel-runner.jar -camel.jbang.build.image.image=default/demo:1.0.0 -camel.jbang.build.image.source-image=java:openjdk-11-ubi8 -camel.jbang.build.image.from=gcr.io/distroless/java:11 -camel.jbang.deploy=true -camel.jbang.deploy.openshift=false -camel.jbang.deploy.minikube=true -camel.jbang.deploy.image=default/demo:1.0.0 -camel.jbang.deploy.replicas=1 -camel.jbang.deploy.node-port=30777 -camel.jbang.undeploy.openshift=false -camel.jbang.undeploy.minikube=true -camel.jbang.manifests=true -camel.jbang.manifests.path=true -camel.jbang.manifests.openshift=false -camel.jbang.manifests.minikube=true -camel.jbang.manifests.image=default/demo:1.0.0 -camel.jbang.manifests.replicas=1 -camel.jbang.manifests.node-port=30777 -camel.jbang.manifests.jar=camel-runner.jar \ No newline at end of file diff --git a/karavan-demo/placeholder/demo.yaml b/karavan-demo/placeholder/demo.yaml deleted file mode 100644 index 222464c3..00000000 --- a/karavan-demo/placeholder/demo.yaml +++ /dev/null @@ -1,9 +0,0 @@ -- route: - from: - uri: kamelet:timer-source - steps: - - log: - message: ${body} - parameters: - period: 2000 - message: '{{message}}' diff --git a/karavan-demo/placeholder/local.properties b/karavan-demo/placeholder/local.properties deleted file mode 100644 index f82f431e..00000000 --- a/karavan-demo/placeholder/local.properties +++ /dev/null @@ -1,21 +0,0 @@ -message=Local Placeholder! -camel.jbang.project.cleanup=false -camel.jbang.package=true -camel.jbang.package.uber-jar.fresh=true -camel.main.routesIncludePattern=file:demo.yaml -camel.jbang.build.image=false -camel.jbang.build.image.openshift=false -camel.jbang.build.image.build-config=false -camel.jbang.build.image.push=false -camel.jbang.build.image.image=undefined/undefined:undefined -camel.jbang.deploy=false -camel.jbang.deploy.openshift=false -camel.jbang.deploy.minikube=false -camel.jbang.deploy.image=undefined/undefined:undefined -camel.jbang.undeploy.openshift=false -camel.jbang.undeploy.minikube=false -camel.jbang.manifests=false -camel.jbang.manifests.path=false -camel.jbang.manifests.openshift=false -camel.jbang.manifests.minikube=false -camel.jbang.manifests.image=undefined/undefined:undefined \ No newline at end of file diff --git a/karavan-demo/rest-service/quarkus/CreateNewUser.java b/karavan-demo/rest-service/quarkus/CreateNewUser.java deleted file mode 100644 index e581232d..00000000 --- a/karavan-demo/rest-service/quarkus/CreateNewUser.java +++ /dev/null @@ -1,14 +0,0 @@ -import org.apache.camel.Exchange; -import org.apache.camel.Processor; - -import javax.inject.Named; -import javax.inject.Singleton; - -@Singleton -@Named("CreateNewUser") -public class CreateNewUser implements Processor { - - public void process(Exchange exchange) throws Exception { - exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, "202"); - } -} \ No newline at end of file diff --git a/karavan-demo/rest-service/quarkus/DeleteUserById.java b/karavan-demo/rest-service/quarkus/DeleteUserById.java deleted file mode 100644 index 78e21694..00000000 --- a/karavan-demo/rest-service/quarkus/DeleteUserById.java +++ /dev/null @@ -1,15 +0,0 @@ -import org.apache.camel.Exchange; -import org.apache.camel.Processor; - -import javax.inject.Named; -import javax.inject.Singleton; - -@Singleton -@Named("DeleteUserById") -public class DeleteUserById implements Processor { - - public void process(Exchange exchange) throws Exception { - exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, "200"); - exchange.getOut().setBody("User Deleted"); - } -} \ No newline at end of file diff --git a/karavan-demo/rest-service/quarkus/GetAllUsers.java b/karavan-demo/rest-service/quarkus/GetAllUsers.java deleted file mode 100644 index 3399b793..00000000 --- a/karavan-demo/rest-service/quarkus/GetAllUsers.java +++ /dev/null @@ -1,16 +0,0 @@ -import org.apache.camel.Exchange; -import org.apache.camel.Processor; - -import javax.inject.Named; -import javax.inject.Singleton; - -@Singleton -@Named("GetAllUsers") -public class GetAllUsers implements Processor { - - public void process(Exchange exchange) throws Exception { - - exchange.getOut().setBody("[{\"username\":\"Karavan1\"},{\"username\":\"Karavan2\"}]"); - exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, "200"); - } -} \ No newline at end of file diff --git a/karavan-demo/rest-service/quarkus/GetUserById.java b/karavan-demo/rest-service/quarkus/GetUserById.java deleted file mode 100644 index e123af31..00000000 --- a/karavan-demo/rest-service/quarkus/GetUserById.java +++ /dev/null @@ -1,15 +0,0 @@ -import org.apache.camel.Exchange; -import org.apache.camel.Processor; - -import javax.inject.Named; -import javax.inject.Singleton; - -@Singleton -@Named("GetUserById") -public class GetUserById implements Processor { - - public void process(Exchange exchange) throws Exception { - exchange.getOut().setBody("{\"username\":\"Karavan\"" +exchange.getIn().getHeader(Exchange.HTTP_PATH) + "}"); - exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, "200"); - } -} \ No newline at end of file diff --git a/karavan-demo/rest-service/quarkus/Readme.md b/karavan-demo/rest-service/quarkus/Readme.md deleted file mode 100644 index 18250893..00000000 --- a/karavan-demo/rest-service/quarkus/Readme.md +++ /dev/null @@ -1,11 +0,0 @@ -1. This example explains the setup of Rest service using Karavan -2. This service listen on Nodeport 30011 -3. Supported Rest API's - ``` - | METHOD | PATH | BODY |RETURN | - |--------|-----------------------------------------|------------------|---------| - | GET | http://localhost:30011/v1/users | | 200 | - | GET | http://localhost:30011/v1/users/karavan | | 200 | - | DELETE | http://localhost:30011/v1/users/karavan | | 200 | - | POST | http://localhost:30011/v1/users |{"name":"karavan"}| 202 | - ``` diff --git a/karavan-demo/rest-service/quarkus/application.properties b/karavan-demo/rest-service/quarkus/application.properties deleted file mode 100644 index 2433a42c..00000000 --- a/karavan-demo/rest-service/quarkus/application.properties +++ /dev/null @@ -1,15 +0,0 @@ -camel.karavan.project-id=openapi -camel.karavan.project-name=OpenApi -camel.karavan.project-description=Example to show Openapi usage -camel.jbang.gav=org.camel.karavan.demo:openapi:1 -camel.jbang.runtime=quarkus -camel.jbang.quarkusVersion=2.16.7.Final -camel.jbang.dependencies=camel:microprofile-health,mvn:io.quarkus:quarkus-kubernetes,mvn:io.quarkus:quarkus-container-image-jib -camel.health.enabled=true -camel.health.exposure-level=full -quarkus.container-image.name=openapi -quarkus.kubernetes.replicas=2 -quarkus.kubernetes.ports."ports".host-port=30011 -quarkus.kubernetes.ports."ports".container-port=8080 -quarkus.kubernetes.service-type=NodePort -quarkus.kubernetes.ports."ports".node-port=30011 \ No newline at end of file diff --git a/karavan-demo/rest-service/quarkus/users.yaml b/karavan-demo/rest-service/quarkus/users.yaml deleted file mode 100644 index f5165c28..00000000 --- a/karavan-demo/rest-service/quarkus/users.yaml +++ /dev/null @@ -1,78 +0,0 @@ -- rest: - id: rest-c531 - delete: - - id: delete-33db - param: - - name: id - type: path - dataType: integer - description: The user ID. - required: true - path: '/users/{id}' - to: 'direct:rest4' - get: - - id: get-b4ae - path: /users - description: Optional extended description in CommonMark or HTML. - produces: application/json - to: 'direct:rest1' - - id: get-e323 - param: - - name: metadata - type: query - dataType: boolean - description: Optional extended description in CommonMark or HTML. - required: false - - name: id - type: path - dataType: integer - description: The user ID. - required: true - path: '/users/{id}' - to: 'direct:rest3' - post: - - id: post-9770 - param: - - name: body - type: body - required: true - path: /users - consumes: application/json - to: 'direct:rest2' - path: /v1 -- route: - id: route-e42a - from: - uri: 'direct:rest4' - id: from-5726 - steps: - - process: - ref: DeleteUserById - id: process-b244 -- route: - id: route-9e81 - from: - uri: 'direct:rest1' - id: from-1004 - steps: - - process: - ref: GetAllUsers - id: process-2fa0 -- route: - id: route-1f92 - from: - uri: 'direct:rest3' - id: from-dad4 - steps: - - process: - ref: GetUserById - id: process-fe23 -- route: - id: route-8560 - from: - uri: 'direct:rest2' - id: from-31dd - steps: - - process: - ref: CreateNewUser - id: process-7025