From 45b5c2238eb61328911a7baa0b4185c6db4d90f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Thu, 30 Apr 2020 14:20:39 +0200 Subject: [PATCH] first commit --- configuration/settings.xml | 235 ++++++++++++++++++++ pom.xml | 168 ++++++++++++++ src/main/fabric8/deployment.yml | 15 ++ src/main/java/fr/itix/Application.java | 34 +++ src/main/resources/application.properties | 9 + src/main/resources/logback.xml | 17 ++ src/main/resources/spring/camel-context.xml | 16 ++ 7 files changed, 494 insertions(+) create mode 100644 configuration/settings.xml create mode 100644 pom.xml create mode 100644 src/main/fabric8/deployment.yml create mode 100644 src/main/java/fr/itix/Application.java create mode 100644 src/main/resources/application.properties create mode 100644 src/main/resources/logback.xml create mode 100644 src/main/resources/spring/camel-context.xml diff --git a/configuration/settings.xml b/configuration/settings.xml new file mode 100644 index 0000000..7e8ceee --- /dev/null +++ b/configuration/settings.xml @@ -0,0 +1,235 @@ + + + + + + + fuse.repos + + + + + maven.central + Maven Central + https://repo1.maven.org/maven2 + + false + + + true + never + + + + + + redhat.ga + Red Hat General Availability Repository + https://maven.repository.redhat.com/ga + + false + + + true + never + + + + + + redhat.ea + Red Hat Early Access Repository + https://maven.repository.redhat.com/earlyaccess/all + + false + + + true + never + + + + + + jboss.ea + JBoss Early Access Repository + http://repository.jboss.org/nexus/content/groups/ea + + false + + + true + never + + + + + + jboss.brew + JBoss Brew Repository + http://download-node-02.eng.bos.redhat.com/brewroot/repos/jb-common-build/latest/maven/ + + false + + + true + never + + + + + + fis.brew + FIS Brew Repository + http://download-node-02.eng.bos.redhat.com/brewroot/repos/jb-fis-2.0-maven-build/latest/maven/ + + false + + + true + never + + + + + + eap.brew + EAP Brew Repository + http://download.eng.bos.redhat.com/brewroot/repos/jb-eap-7.1-rhel-7-maven-build/latest/maven/ + + false + + + true + never + + + + + + + + + maven.central + Maven Central + https://repo1.maven.org/maven2 + + false + + + true + never + + + + + + redhat.ga + Red Hat General Availability Repository + https://maven.repository.redhat.com/ga + + false + + + true + never + + + + + + redhat.ea + Red Hat Early Access Repository + https://maven.repository.redhat.com/earlyaccess/all + + false + + + true + never + + + + + + jboss.ea + JBoss Early Access Repository + http://repository.jboss.org/nexus/content/groups/ea + + false + + + true + never + + + + + + jboss.brew + JBoss Brew Repository + http://download-node-02.eng.bos.redhat.com/brewroot/repos/jb-common-build/latest/maven/ + + false + + + true + never + + + + + + fis.brew + FIS Brew Repository + http://download-node-02.eng.bos.redhat.com/brewroot/repos/jb-fis-2.0-maven-build/latest/maven/ + + false + + + true + never + + + + + + eap.brew + EAP Brew Repository + http://download.eng.bos.redhat.com/brewroot/repos/jb-eap-7.1-rhel-7-maven-build/latest/maven/ + + false + + + true + never + + + + + + + + + fuse.repos + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..8543b83 --- /dev/null +++ b/pom.xml @@ -0,0 +1,168 @@ + + + 4.0.0 + fr.itix + save-next-todo + 1.0.0-SNAPSHOT + Camel Demo + Part of my Fuse Online demo + + 3.6.0 + 7.6.0.fuse-760027-redhat-00001 + UTF-8 + 2.19.1 + + + + + org.jboss.redhat-fuse + fuse-springboot-bom + 7.6.0.fuse-760027-redhat-00001 + pom + import + + + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.apache.camel + camel-jsonpath + 2.21.0.fuse-760027-redhat-00001 + + + org.apache.camel + camel-spring-boot-starter + 2.21.0.fuse-760027-redhat-00001 + + + org.apache.camel + camel-netty4-http + 2.21.0.fuse-760027-redhat-00001 + + + + + red-hat-ga-repository + https://maven.repository.redhat.com/ga + + + red-hat-early-access-repository + https://maven.repository.redhat.com/earlyaccess/all + + + jboss-early-access-repository + https://repository.jboss.org/nexus/content/groups/ea + + + + + red-hat-ga-repository + https://maven.repository.redhat.com/ga + + + red-hat-early-access-repository + https://maven.repository.redhat.com/earlyaccess/all + + + jboss-early-access-repository + https://repository.jboss.org/nexus/content/groups/ea + + + + spring-boot:run + + + maven-compiler-plugin + ${maven-compiler-plugin.version} + + 1.8 + 1.8 + + + + org.jboss.redhat-fuse + spring-boot-maven-plugin + ${fuse.version} + + + + repackage + + + + + + org.jboss.redhat-fuse + fabric8-maven-plugin + ${fuse.version} + + + + resource + build + + + + + + + + + jdk9+-build + + [9,) + + + + javax.annotation + javax.annotation-api + + + javax.xml.ws + jaxws-api + 2.3.0 + + + jaxb-api + javax.xml.bind + + + + + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.2 + + + com.sun.activation + javax.activation + 1.2.0 + + + org.apache.geronimo.specs + geronimo-ws-metadata_2.0_spec + 1.1.3 + + + com.sun.xml.messaging.saaj + saaj-impl + 1.4.0-b03 + + + org.apache.geronimo.specs + geronimo-jta_1.1_spec + + + org.jboss.spec.javax.rmi + jboss-rmi-api_1.0_spec + 1.0.6.Final + + + + + diff --git a/src/main/fabric8/deployment.yml b/src/main/fabric8/deployment.yml new file mode 100644 index 0000000..7ad634c --- /dev/null +++ b/src/main/fabric8/deployment.yml @@ -0,0 +1,15 @@ +spec: + template: + spec: + containers: + - + resources: + requests: + cpu: "0.2" +# memory: 256Mi + limits: + cpu: "1.0" +# memory: 256Mi + env: + - name: SPRING_APPLICATION_JSON + value: '{"server":{"tomcat":{"max-threads":1}}}' diff --git a/src/main/java/fr/itix/Application.java b/src/main/java/fr/itix/Application.java new file mode 100644 index 0000000..56136e7 --- /dev/null +++ b/src/main/java/fr/itix/Application.java @@ -0,0 +1,34 @@ +/** + * Copyright 2005-2018 Red Hat, Inc. + * + * Red Hat 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 + * + * https://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. + */ +package fr.itix; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ImportResource; + +/** + * A spring-boot application that includes a Camel route builder to setup the Camel routes + */ +@SpringBootApplication +@ImportResource({"classpath:spring/camel-context.xml"}) +public class Application { + + // must have a main method spring-boot can run + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..d162ff4 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,9 @@ +logging.config=classpath:logback.xml + +# the options from org.apache.camel.spring.boot.CamelConfigurationProperties can be configured here +camel.springboot.name=SaveNextTodo +apicast.hostname=fuse-online-i-next-todo-3scale-apicast-staging.apps.ocp4.itix.fr +apicast.apikey=d2cff6d6f40c48632322b0d651740995 + +spring.main.web-application-type=none +camel.springboot.main-run-controller=true diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 0000000..d0b4334 --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,17 @@ + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + diff --git a/src/main/resources/spring/camel-context.xml b/src/main/resources/spring/camel-context.xml new file mode 100644 index 0000000..1e77354 --- /dev/null +++ b/src/main/resources/spring/camel-context.xml @@ -0,0 +1,16 @@ + + + + + + + + + + $.name + + + + +