This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new e3d11d6 CAMEL-13106: Move saga component out of camel-core e3d11d6 is described below commit e3d11d61d84018d06985298b701eba10616d629c Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Wed Jan 23 11:20:12 2019 +0100 CAMEL-13106: Move saga component out of camel-core --- apache-camel/pom.xml | 10 + apache-camel/src/main/descriptors/common-bin.xml | 2 + camel-core/pom.xml | 6 +- camel-core/readme.adoc | 83 ----- .../apache/camel/saga/CamelSagaCoordinator.java | 0 .../org/apache/camel/saga/CamelSagaService.java | 0 .../java/org/apache/camel/saga/CamelSagaStep.java | 0 .../main/java/org/apache/camel/saga/package.html | 0 components/camel-lra/pom.xml | 5 +- components/camel-saga/pom.xml | 343 +++++++++++++++++++++ .../camel-saga}/src/main/docs/saga-component.adoc | 0 .../apache/camel/component/saga/SagaComponent.java | 0 .../apache/camel/component/saga/SagaEndpoint.java | 0 .../apache/camel/component/saga/SagaProducer.java | 0 components/pom.xml | 1 + components/readme.adoc | 69 ++--- parent/pom.xml | 10 + .../components-starter/camel-saga-starter/pom.xml | 53 ++++ .../springboot/SagaComponentAutoConfiguration.java | 128 ++++++++ .../springboot/SagaComponentConfiguration.java | 55 ++++ .../src/main/resources/META-INF/LICENSE.txt | 203 ++++++++++++ .../src/main/resources/META-INF/NOTICE.txt | 11 + .../src/main/resources/META-INF/spring.factories | 19 ++ .../src/main/resources/META-INF/spring.provides | 17 + platforms/spring-boot/components-starter/pom.xml | 1 + 25 files changed, 887 insertions(+), 129 deletions(-) diff --git a/apache-camel/pom.xml b/apache-camel/pom.xml index bb588d6..8b1d21f 100644 --- a/apache-camel/pom.xml +++ b/apache-camel/pom.xml @@ -1055,6 +1055,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-saga</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-salesforce</artifactId> <version>${project.version}</version> </dependency> @@ -2374,6 +2379,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-saga-starter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-salesforce-starter</artifactId> <version>${project.version}</version> </dependency> diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml index 62e938f..08dc5ae 100644 --- a/apache-camel/src/main/descriptors/common-bin.xml +++ b/apache-camel/src/main/descriptors/common-bin.xml @@ -232,6 +232,7 @@ <include>org.apache.camel:camel-rmi</include> <include>org.apache.camel:camel-rss</include> <include>org.apache.camel:camel-rxjava2</include> + <include>org.apache.camel:camel-saga</include> <include>org.apache.camel:camel-salesforce</include> <include>org.apache.camel:camel-sap-netweaver</include> <include>org.apache.camel:camel-saxon</include> @@ -533,6 +534,7 @@ <include>org.apache.camel:camel-rmi-starter</include> <include>org.apache.camel:camel-rss-starter</include> <include>org.apache.camel:camel-rxjava2-starter</include> + <include>org.apache.camel:camel-saga-starter</include> <include>org.apache.camel:camel-salesforce-starter</include> <include>org.apache.camel:camel-sap-netweaver-starter</include> <include>org.apache.camel:camel-saxon-starter</include> diff --git a/camel-core/pom.xml b/camel-core/pom.xml index 54308ca..8674fe6 100644 --- a/camel-core/pom.xml +++ b/camel-core/pom.xml @@ -67,7 +67,6 @@ org.apache.camel.spi.ComponentResolver;component=properties, org.apache.camel.spi.ComponentResolver;component=rest, org.apache.camel.spi.ComponentResolver;component=rest-api, - org.apache.camel.spi.ComponentResolver;component=saga, org.apache.camel.spi.ComponentResolver;component=seda, org.apache.camel.spi.ComponentResolver;component=test, org.apache.camel.spi.ComponentResolver;component=validator, @@ -203,6 +202,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-saga</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-scheduler</artifactId> <version>${project.version}</version> </dependency> diff --git a/camel-core/readme.adoc b/camel-core/readme.adoc index b8b6968..9d6c5f1 100644 --- a/camel-core/readme.adoc +++ b/camel-core/readme.adoc @@ -5,52 +5,7 @@ // components: START -Number of Components: 13 in 1 JAR artifacts (0 deprecated) -[width="100%",cols="4,1,5",options="header"] -|=== -| Component | Available From | Description - -| link:src/main/docs/bean-component.adoc[Bean] (camel-core) + -`bean:beanName` | 1.0 | The bean component is for invoking Java beans from Camel. - -| link:src/main/docs/class-component.adoc[Class] (camel-core) + -`class:beanName` | 2.4 | The Class Component is for invoking Java Classes (Java beans) from Camel. - -| link:src/main/docs/controlbus-component.adoc[Control Bus] (camel-core) + -`controlbus:command:language` | 2.11 | The controlbus component provides easy management of Camel applications based on the Control Bus EIP pattern. - -| link:src/main/docs/dataset-component.adoc[Dataset] (camel-core) + -`dataset:name` | 1.3 | The dataset component provides a mechanism to easily perform load & soak testing of your system. - -| link:src/main/docs/file-component.adoc[File] (camel-core) + -`file:directoryName` | 1.0 | The file component is used for reading or writing files. - -| link:src/main/docs/mock-component.adoc[Mock] (camel-core) + -`mock:name` | 1.0 | The mock component is used for testing routes and mediation rules using mocks. - -| link:src/main/docs/properties-component.adoc[Properties] (camel-core) + -`properties:key` | 2.3 | The properties component is used for using property placeholders in endpoint uris. - -| link:src/main/docs/rest-component.adoc[REST] (camel-core) + -`rest:method:path:uriTemplate` | 2.14 | The rest component is used for either hosting REST services (consumer) or calling external REST services (producer). - -| link:src/main/docs/rest-api-component.adoc[REST API] (camel-core) + -`rest-api:path/contextIdPattern` | 2.16 | The rest-api component is used for providing Swagger API of the REST services which has been defined using the rest-dsl in Camel. - -| link:src/main/docs/saga-component.adoc[Saga] (camel-core) + -`saga:action` | 2.21 | The saga component provides access to advanced options for managing the flow in the Saga EIP. - -| link:src/main/docs/test-component.adoc[Test] (camel-core) + -`test:name` | 1.3 | The test component extends the mock component by on startup to pull messages from another endpoint to set the expected message bodies. - -| link:src/main/docs/validator-component.adoc[Validator] (camel-core) + -`validator:resourceUri` | 1.1 | Validates the payload of a message using XML Schema and JAXP Validation. - -| link:src/main/docs/xslt-component.adoc[XSLT] (camel-core) + -`xslt:resourceUri` | 1.3 | Transforms the message using a XSLT template. - -|=== // components: END @@ -65,20 +20,7 @@ Number of Components: 13 in 1 JAR artifacts (0 deprecated) // dataformats: START -Number of Data Formats: 4 in 35 JAR artifacts (0 deprecated) -[width="100%",cols="4,1,5",options="header"] -|=== -| Data Format | Available From | Description - -| link:src/main/docs/gzip-dataformat.adoc[GZip] (camel-core) | 2.0 | The GZip data format is a message compression and de-compression format (which works with the popular gzip/gunzip tools). - -| link:src/main/docs/serialization-dataformat.adoc[Java Object Serialization] (camel-core) | 2.12 | Serialization is a data format which uses the standard Java Serialization mechanism to unmarshal a binary payload into Java objects or to marshal Java objects into a binary blob. - -| link:src/main/docs/string-dataformat.adoc[String Encoding] (camel-core) | 2.12 | String data format is a textual based format that supports character encoding. - -| link:src/main/docs/zip-dataformat.adoc[Zip Deflate Compression] (camel-core) | 2.12 | Zip Deflate Compression data format is a message compression and de-compression format (not zip files). -|=== // dataformats: END @@ -94,32 +36,7 @@ Number of Data Formats: 4 in 35 JAR artifacts (0 deprecated) // languages: START -Number of Languages: 10 in 1 JAR artifacts (0 deprecated) - -[width="100%",cols="4,1,5",options="header"] -|=== -| Language | Available From | Description - -| link:src/main/docs/bean-language.adoc[Bean method] (camel-core) | 1.3 | To use a Java bean (aka method call) in Camel expressions or predicates. - -| link:src/main/docs/constant-language.adoc[Constant] (camel-core) | 1.5 | To use a constant value in Camel expressions or predicates. - -| link:src/main/docs/exchangeProperty-language.adoc[ExchangeProperty] (camel-core) | 2.0 | To use a Camel Exchange property in expressions or predicates. - -| link:src/main/docs/file-language.adoc[File] (camel-core) | 1.1 | For expressions and predicates using the file/simple language - -| link:src/main/docs/header-language.adoc[Header] (camel-core) | 1.5 | To use a Camel Message header in expressions or predicates. - -| link:src/main/docs/ref-language.adoc[Ref] (camel-core) | 2.8 | Reference to an existing Camel expression or predicate, which is looked up from the Camel registry. - -| link:src/main/docs/simple-language.adoc[Simple] (camel-core) | 1.1 | To use Camels built-in Simple language in Camel expressions or predicates. - -| link:src/main/docs/tokenize-language.adoc[Tokenize] (camel-core) | 2.0 | To use Camel message body or header with a tokenizer in Camel expressions or predicates. - -| link:src/main/docs/xtokenize-language.adoc[XML Tokenize] (camel-core) | 2.14 | To use Camel message body or header with a XML tokenizer in Camel expressions or predicates. -| link:src/main/docs/xpath-language.adoc[XPath] (camel-core) | 1.1 | To use XPath (XML) in Camel expressions or predicates. -|=== // languages: END diff --git a/camel-base/src/main/java/org/apache/camel/saga/CamelSagaCoordinator.java b/camel-support/src/main/java/org/apache/camel/saga/CamelSagaCoordinator.java similarity index 100% rename from camel-base/src/main/java/org/apache/camel/saga/CamelSagaCoordinator.java rename to camel-support/src/main/java/org/apache/camel/saga/CamelSagaCoordinator.java diff --git a/camel-base/src/main/java/org/apache/camel/saga/CamelSagaService.java b/camel-support/src/main/java/org/apache/camel/saga/CamelSagaService.java similarity index 100% rename from camel-base/src/main/java/org/apache/camel/saga/CamelSagaService.java rename to camel-support/src/main/java/org/apache/camel/saga/CamelSagaService.java diff --git a/camel-base/src/main/java/org/apache/camel/saga/CamelSagaStep.java b/camel-support/src/main/java/org/apache/camel/saga/CamelSagaStep.java similarity index 100% rename from camel-base/src/main/java/org/apache/camel/saga/CamelSagaStep.java rename to camel-support/src/main/java/org/apache/camel/saga/CamelSagaStep.java diff --git a/camel-base/src/main/java/org/apache/camel/saga/package.html b/camel-support/src/main/java/org/apache/camel/saga/package.html similarity index 100% rename from camel-base/src/main/java/org/apache/camel/saga/package.html rename to camel-support/src/main/java/org/apache/camel/saga/package.html diff --git a/components/camel-lra/pom.xml b/components/camel-lra/pom.xml index 213f512..cf05129 100644 --- a/components/camel-lra/pom.xml +++ b/components/camel-lra/pom.xml @@ -44,7 +44,10 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> </dependency> - + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-saga</artifactId> + </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-rs-client</artifactId> diff --git a/components/camel-saga/pom.xml b/components/camel-saga/pom.xml new file mode 100644 index 0000000..e9a25fe --- /dev/null +++ b/components/camel-saga/pom.xml @@ -0,0 +1,343 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.camel</groupId> + <artifactId>components</artifactId> + <version>3.0.0-SNAPSHOT</version> + </parent> + + <artifactId>camel-saga</artifactId> + <packaging>jar</packaging> + <name>Camel :: Saga</name> + <description>Camel Saga component</description> + + <properties> + <camel.osgi.import> + ${camel.osgi.import.defaults}, + * + </camel.osgi.import> + <camel.osgi.export.pkg>org.apache.camel.component.saga.*</camel.osgi.export.pkg> + <camel.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=saga</camel.osgi.export.service> + <!-- do not skip any tests by default --> + <platform.skip.tests/> + </properties> + <dependencies> + + <!-- required dependencies by camel-core --> + <!-- it will be shade into camel-core by bnd plugin --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>spi-annotations</artifactId> + <version>${project.version}</version> + <optional>true</optional> + </dependency> + + <!-- required dependencies by camel-core --> + <!-- it will be shade into camel-core by bnd plugin --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>meta-annotations</artifactId> + <version>${project.version}</version> + <optional>true</optional> + </dependency> + + <!-- required dependencies by camel-core --> + <!-- it will be shade into camel-core by bnd plugin --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-util</artifactId> + <version>${project.version}</version> + </dependency> + + <!-- required dependencies by camel-core --> + <!-- it will be shade into camel-core by bnd plugin --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-api</artifactId> + <version>${project.version}</version> + </dependency> + + <!-- required dependencies by camel-core --> + <!-- it will be shade into camel-core by bnd plugin --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-management-api</artifactId> + <version>${project.version}</version> + </dependency> + + <!-- required dependencies by camel-core --> + <!-- it will be shade into camel-core by bnd plugin --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-support</artifactId> + <version>${project.version}</version> + </dependency> + + <!-- required dependencies by camel-core --> + <!-- which we shade into camel-core so its available for everybody out of the box --> + <dependency> + <groupId>com.github.ben-manes.caffeine</groupId> + <artifactId>caffeine</artifactId> + </dependency> + <!-- we shade our patched ordered json-simple parser --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>json-simple-ordered</artifactId> + <version>${project.version}</version> + </dependency> + + <!-- required dependencies by camel-core --> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + + <!-- osgi support --> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.core</artifactId> + <scope>provided</scope> + <optional>true</optional> + </dependency> + + <!-- testing --> + <dependency> + <groupId>org.codehaus.woodstox</groupId> + <artifactId>woodstox-core-asl</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + <exclusions> + <exclusion> + <artifactId>hamcrest-core</artifactId> + <groupId>org.hamcrest</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.openjdk.jmh</groupId> + <artifactId>jmh-core</artifactId> + <version>1.21</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.openjdk.jmh</groupId> + <artifactId>jmh-generator-annprocess</artifactId> + <version>1.21</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>java-hamcrest</artifactId> + <version>${hamcrest-version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.awaitility</groupId> + <artifactId>awaitility</artifactId> + <scope>test</scope> + <exclusions> + <exclusion> + <artifactId>hamcrest-core</artifactId> + <groupId>org.hamcrest</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.assertj</groupId> + <artifactId>assertj-core</artifactId> + <version>${assertj-version}</version> + <scope>test</scope> + </dependency> + + <!-- logging --> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-api</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-slf4j-impl</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <scope>test</scope> + </dependency> + + <!-- for json tests --> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-core</artifactId> + <scope>test</scope> + </dependency> + + <!-- validator --> + <dependency> + <groupId>xml-resolver</groupId> + <artifactId>xml-resolver</artifactId> + <version>${xml-resolver-version}</version> + <scope>test</scope> + </dependency> + + </dependencies> + + + <build> + + <plugins> + + <plugin> + <groupId>org.apache.camel</groupId> + <artifactId>camel-package-maven-plugin</artifactId> + <version>${project.version}</version> + <configuration> + <!-- set to true to make build fail fast if missing documentation in docs files --> + <failFast>false</failFast> + </configuration> + <executions> + <execution> + <id>generate</id> + <goals> + <goal>generate-components-list</goal> + <goal>generate-dataformats-list</goal> + <goal>generate-languages-list</goal> + <goal>generate-legal</goal> + </goals> + <phase>process-classes</phase> + </execution> + <execution> + <id>validate</id> + <goals> + <goal>validate-components</goal> + <goal>prepare-spring-boot-starter</goal> + <goal>prepare-spring-boot-auto-configuration</goal> + </goals> + <phase>prepare-package</phase> + </execution> + <execution> + <id>readme</id> + <goals> + <goal>update-readme</goal> + </goals> + <phase>package</phase> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <executions> + <execution> + <id>copy-generated-resources</id> + <goals> + <goal>resources</goal> + </goals> + <phase>process-classes</phase> + <configuration> + <resources> + <resource> + <directory>${basedir}/target/generated/camel/components</directory> + </resource> + <resource> + <directory>${basedir}/target/generated/camel/dataformats</directory> + </resource> + <resource> + <directory>${basedir}/target/generated/camel/languages</directory> + </resource> + <resource> + <directory>${basedir}/target/generated/camel/models</directory> + </resource> + <resource> + <directory>${basedir}/target/generated/camel/jaxb</directory> + </resource> + <resource> + <directory>${basedir}/target/generated/camel/legal</directory> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>validate</id> + <build> + <plugins> + <!-- to validate Camel endpoints: mvn camel:validate -Pvalidate --> + <plugin> + <groupId>org.apache.camel</groupId> + <artifactId>camel-maven-plugin</artifactId> + <version>${project.version}</version> + <configuration> + <failOnError>true</failOnError> + <includeTest>true</includeTest> + <ignoreLenientProperties>false</ignoreLenientProperties> + </configuration> + </plugin> + </plugins> + </build> + </profile> + + <!-- enables the APT dependency so that it can be disabled in IDE builds --> + <profile> + <id>apt</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + + <dependencies> + + <!-- enable the APT processor --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>apt</artifactId> + <scope>provided</scope> + </dependency> + + </dependencies> + </profile> + + </profiles> + +</project> diff --git a/camel-core/src/main/docs/saga-component.adoc b/components/camel-saga/src/main/docs/saga-component.adoc similarity index 100% rename from camel-core/src/main/docs/saga-component.adoc rename to components/camel-saga/src/main/docs/saga-component.adoc diff --git a/camel-core/src/main/java/org/apache/camel/component/saga/SagaComponent.java b/components/camel-saga/src/main/java/org/apache/camel/component/saga/SagaComponent.java similarity index 100% rename from camel-core/src/main/java/org/apache/camel/component/saga/SagaComponent.java rename to components/camel-saga/src/main/java/org/apache/camel/component/saga/SagaComponent.java diff --git a/camel-core/src/main/java/org/apache/camel/component/saga/SagaEndpoint.java b/components/camel-saga/src/main/java/org/apache/camel/component/saga/SagaEndpoint.java similarity index 100% rename from camel-core/src/main/java/org/apache/camel/component/saga/SagaEndpoint.java rename to components/camel-saga/src/main/java/org/apache/camel/component/saga/SagaEndpoint.java diff --git a/camel-core/src/main/java/org/apache/camel/component/saga/SagaProducer.java b/components/camel-saga/src/main/java/org/apache/camel/component/saga/SagaProducer.java similarity index 100% rename from camel-core/src/main/java/org/apache/camel/component/saga/SagaProducer.java rename to components/camel-saga/src/main/java/org/apache/camel/component/saga/SagaProducer.java diff --git a/components/pom.xml b/components/pom.xml index 09f08a4..a22d4fc 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -245,6 +245,7 @@ <module>camel-rmi</module> <module>camel-rss</module> <module>camel-rxjava2</module> + <module>camel-saga</module> <module>camel-sap-netweaver</module> <module>camel-saxon</module> <module>camel-scheduler</module> diff --git a/components/readme.adoc b/components/readme.adoc index f462c02..fd08267 100644 --- a/components/readme.adoc +++ b/components/readme.adoc @@ -1,7 +1,7 @@ ==== Components // components: START -Number of Components: 286 in 202 JAR artifacts (0 deprecated) +Number of Components: 289 in 204 JAR artifacts (0 deprecated) [width="100%",cols="4,1,5",options="header"] |=== @@ -118,7 +118,7 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-azure/src/main/docs/azure-queue-component.adoc[Azure Storage Queue Service] (camel-azure) + `azure-queue:containerAndQueueUri` | 2.19 | The azure-queue component is used for storing and retrieving messages from Azure Storage Queue Service. -| link:../camel-core/src/main/docs/bean-component.adoc[Bean] (camel-core) + +| link:@@@ARTIFACTID@@@/src/main/docs/bean-component.adoc[Bean] (@@@ARTIFACTID@@@) + `bean:beanName` | 1.0 | The bean component is for invoking Java beans from Camel. | link:camel-bean-validator/src/main/docs/bean-validator-component.adoc[Bean Validator] (camel-bean-validator) + @@ -154,7 +154,7 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-chunk/src/main/docs/chunk-component.adoc[Chunk] (camel-chunk) + `chunk:resourceUri` | 2.15 | Transforms the message using a Chunk template. -| link:../camel-core/src/main/docs/class-component.adoc[Class] (camel-core) + +| link:@@@ARTIFACTID@@@/src/main/docs/class-component.adoc[Class] (@@@ARTIFACTID@@@) + `class:beanName` | 2.4 | The Class Component is for invoking Java Classes (Java beans) from Camel. | link:camel-cm-sms/src/main/docs/cm-sms-component.adoc[CM SMS Gateway] (camel-cm-sms) + @@ -172,7 +172,7 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-consul/src/main/docs/consul-component.adoc[Consul] (camel-consul) + `consul:apiEndpoint` | 2.18 | The camel consul component allows you to work with Consul, a distributed, highly available, datacenter-aware, service discovery and configuration system. -| link:../camel-core/src/main/docs/controlbus-component.adoc[Control Bus] (camel-core) + +| link:@@@ARTIFACTID@@@/src/main/docs/controlbus-component.adoc[Control Bus] (@@@ARTIFACTID@@@) + `controlbus:command:language` | 2.11 | The controlbus component provides easy management of Camel applications based on the Control Bus EIP pattern. | link:camel-corda/src/main/docs/corda-component.adoc[corda] (camel-corda) + @@ -199,7 +199,7 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-dataformat/src/main/docs/dataformat-component.adoc[Data Format] (camel-dataformat) + `dataformat:name:operation` | 2.12 | The dataformat component is used for working with Data Formats as if it was a regular Component supporting Endpoints and URIs. -| link:../camel-core/src/main/docs/dataset-component.adoc[Dataset] (camel-core) + +| link:@@@ARTIFACTID@@@/src/main/docs/dataset-component.adoc[Dataset] (@@@ARTIFACTID@@@) + `dataset:name` | 1.3 | The dataset component provides a mechanism to easily perform load & soak testing of your system. | link:camel-digitalocean/src/main/docs/digitalocean-component.adoc[DigitalOcean] (camel-digitalocean) + @@ -253,7 +253,7 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-fhir/camel-fhir-component/src/main/docs/fhir-component.adoc[FHIR] (camel-fhir) + `fhir:apiName/methodName` | 2.23 | The fhir component is used for working with the FHIR protocol (health care). -| link:../camel-core/src/main/docs/file-component.adoc[File] (camel-core) + +| link:@@@ARTIFACTID@@@/src/main/docs/file-component.adoc[File] (@@@ARTIFACTID@@@) + `file:directoryName` | 1.0 | The file component is used for reading or writing files. | link:camel-flatpack/src/main/docs/flatpack-component.adoc[Flatpack] (camel-flatpack) + @@ -265,6 +265,12 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-freemarker/src/main/docs/freemarker-component.adoc[Freemarker] (camel-freemarker) + `freemarker:resourceUri` | 2.10 | Transforms the message using a FreeMarker template. +| link:camel-ftp/src/main/docs/ftp-component.adoc[FTP] (camel-ftp) + +`ftp:host:port/directoryName` | 1.1 | The ftp component is used for uploading or downloading files from FTP servers. + +| link:camel-ftp/src/main/docs/ftps-component.adoc[FTPS] (camel-ftp) + +`ftps:host:port/directoryName` | 2.2 | The ftps (FTP secure SSL/TLS) component is used for uploading or downloading files from FTP servers. + | link:camel-ganglia/src/main/docs/ganglia-component.adoc[Ganglia] (camel-ganglia) + `ganglia:host:port` | 2.15 | The ganglia component is used for sending metrics to the Ganglia monitoring system. @@ -544,7 +550,7 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-mllp/src/main/docs/mllp-component.adoc[MLLP] (camel-mllp) + `mllp:hostname:port` | 2.17 | Provides functionality required by Healthcare providers to communicate with other systems using the MLLP protocol. -| link:../camel-core/src/main/docs/mock-component.adoc[Mock] (camel-core) + +| link:@@@ARTIFACTID@@@/src/main/docs/mock-component.adoc[Mock] (@@@ARTIFACTID@@@) + `mock:name` | 1.0 | The mock component is used for testing routes and mediation rules using mocks. | link:camel-mongodb3/src/main/docs/mongodb3-component.adoc[MongoDB] (camel-mongodb3) + @@ -643,7 +649,7 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-printer/src/main/docs/lpr-component.adoc[Printer] (camel-printer) + `lpr:hostname:port/printername` | 2.1 | The printer component is used for sending messages to printers as print jobs. -| link:../camel-core/src/main/docs/properties-component.adoc[Properties] (camel-core) + +| link:@@@ARTIFACTID@@@/src/main/docs/properties-component.adoc[Properties] (@@@ARTIFACTID@@@) + `properties:key` | 2.3 | The properties component is used for using property placeholders in endpoint uris. | link:camel-pubnub/src/main/docs/pubnub-component.adoc[PubNub] (camel-pubnub) + @@ -664,10 +670,10 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-ref/src/main/docs/ref-component.adoc[Ref] (camel-ref) + `ref:name` | 1.2 | The ref component is used for lookup of existing endpoints bound in the Registry. -| link:../camel-core/src/main/docs/rest-component.adoc[REST] (camel-core) + +| link:@@@ARTIFACTID@@@/src/main/docs/rest-component.adoc[REST] (@@@ARTIFACTID@@@) + `rest:method:path:uriTemplate` | 2.14 | The rest component is used for either hosting REST services (consumer) or calling external REST services (producer). -| link:../camel-core/src/main/docs/rest-api-component.adoc[REST API] (camel-core) + +| link:@@@ARTIFACTID@@@/src/main/docs/rest-api-component.adoc[REST API] (@@@ARTIFACTID@@@) + `rest-api:path/contextIdPattern` | 2.16 | The rest-api component is used for providing Swagger API of the REST services which has been defined using the rest-dsl in Camel. | link:camel-rest-swagger/src/main/docs/rest-swagger-component.adoc[REST Swagger] (camel-rest-swagger) + @@ -682,7 +688,7 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-rss/src/main/docs/rss-component.adoc[RSS] (camel-rss) + `rss:feedUri` | 2.0 | The rss component is used for consuming RSS feeds. -| link:../camel-core/src/main/docs/saga-component.adoc[Saga] (camel-core) + +| link:camel-saga/src/main/docs/saga-component.adoc[Saga] (camel-saga) + `saga:action` | 2.21 | The saga component provides access to advanced options for managing the flow in the Saga EIP. | link:camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc[Salesforce] (camel-salesforce) + @@ -712,6 +718,9 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-servlet/src/main/docs/servlet-component.adoc[Servlet] (camel-servlet) + `servlet:contextPath` | 2.0 | To use a HTTP Servlet as entry for Camel routes when running in a servlet container. +| link:camel-ftp/src/main/docs/sftp-component.adoc[SFTP] (camel-ftp) + +`sftp:host:port/directoryName` | 1.1 | The sftp (FTP over SSH) component is used for uploading or downloading files from SFTP servers. + | link:camel-sjms/src/main/docs/sjms-component.adoc[Simple JMS] (camel-sjms) + `sjms:destinationType:destinationName` | 2.11 | The sjms component (simple jms) allows messages to be sent to (or consumed from) a JMS Queue or Topic (uses JMS 1.x API). @@ -787,7 +796,7 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-telegram/src/main/docs/telegram-component.adoc[Telegram] (camel-telegram) + `telegram:type/authorizationToken` | 2.18 | The telegram component provides access to the Telegram Bot API. -| link:../camel-core/src/main/docs/test-component.adoc[Test] (camel-core) + +| link:@@@ARTIFACTID@@@/src/main/docs/test-component.adoc[Test] (@@@ARTIFACTID@@@) + `test:name` | 1.3 | The test component extends the mock component by on startup to pull messages from another endpoint to set the expected message bodies. | link:camel-thrift/src/main/docs/thrift-component.adoc[Thrift] (camel-thrift) + @@ -817,7 +826,7 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-undertow/src/main/docs/undertow-component.adoc[Undertow] (camel-undertow) + `undertow:httpURI` | 2.16 | The undertow component provides HTTP and WebSocket based endpoints for consuming and producing HTTP/WebSocket requests. -| link:../camel-core/src/main/docs/validator-component.adoc[Validator] (camel-core) + +| link:@@@ARTIFACTID@@@/src/main/docs/validator-component.adoc[Validator] (@@@ARTIFACTID@@@) + `validator:resourceUri` | 1.1 | Validates the payload of a message using XML Schema and JAXP Validation. | link:camel-velocity/src/main/docs/velocity-component.adoc[Velocity] (camel-velocity) + @@ -850,7 +859,7 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) | link:camel-saxon/src/main/docs/xquery-component.adoc[XQuery] (camel-saxon) + `xquery:resourceUri` | 1.0 | Transforms the message using a XQuery template using Saxon. -| link:../camel-core/src/main/docs/xslt-component.adoc[XSLT] (camel-core) + +| link:@@@ARTIFACTID@@@/src/main/docs/xslt-component.adoc[XSLT] (@@@ARTIFACTID@@@) + `xslt:resourceUri` | 1.3 | Transforms the message using a XSLT template. | link:camel-yammer/src/main/docs/yammer-component.adoc[Yammer] (camel-yammer) + @@ -872,7 +881,7 @@ Number of Components: 286 in 202 JAR artifacts (0 deprecated) ==== Data Formats // dataformats: START -Number of Data Formats: 45 in 35 JAR artifacts (0 deprecated) +Number of Data Formats: 41 in 34 JAR artifacts (0 deprecated) [width="100%",cols="4,1,5",options="header"] |=== @@ -906,16 +915,12 @@ Number of Data Formats: 45 in 35 JAR artifacts (0 deprecated) | link:camel-flatpack/src/main/docs/flatpack-dataformat.adoc[Flatpack] (camel-flatpack) | 2.1 | The Flatpack data format is used for working with flat payloads (such as CSV, delimited, or fixed length formats). -| link:../camel-core/src/main/docs/gzip-dataformat.adoc[GZip] (camel-core) | 2.0 | The GZip data format is a message compression and de-compression format (which works with the popular gzip/gunzip tools). - | link:camel-hl7/src/main/docs/hl7-dataformat.adoc[HL7] (camel-hl7) | 2.0 | The HL7 data format can be used to marshal or unmarshal HL7 (Health Care) model objects. | link:camel-ical/src/main/docs/ical-dataformat.adoc[iCal] (camel-ical) | 2.12 | The iCal dataformat is used for working with iCalendar messages. | link:camel-jacksonxml/src/main/docs/jacksonxml-dataformat.adoc[JacksonXML] (camel-jacksonxml) | 2.16 | JacksonXML data format is used for unmarshal a XML payload to POJO or to marshal POJO back to XML payload. -| link:../camel-core/src/main/docs/serialization-dataformat.adoc[Java Object Serialization] (camel-core) | 2.12 | Serialization is a data format which uses the standard Java Serialization mechanism to unmarshal a binary payload into Java objects or to marshal Java objects into a binary blob. - | link:camel-jaxb/src/main/docs/jaxb-dataformat.adoc[JAXB] (camel-jaxb) | 1.0 | JAXB data format uses the JAXB2 XML marshalling standard to unmarshal an XML payload into Java objects or to marshal Java objects into an XML payload. | link:camel-jibx/src/main/docs/jibx-dataformat.adoc[JiBX] (camel-jibx) | 2.6 | JiBX data format is used for unmarshal a XML payload to POJO or to marshal POJO back to XML payload. @@ -942,8 +947,6 @@ Number of Data Formats: 45 in 35 JAR artifacts (0 deprecated) | link:camel-soap/src/main/docs/soapjaxb-dataformat.adoc[SOAP] (camel-soap) | 2.3 | SOAP is a data format which uses JAXB2 and JAX-WS annotations to marshal and unmarshal SOAP payloads. -| link:../camel-core/src/main/docs/string-dataformat.adoc[String Encoding] (camel-core) | 2.12 | String data format is a textual based format that supports character encoding. - | link:camel-syslog/src/main/docs/syslog-dataformat.adoc[Syslog] (camel-syslog) | 2.6 | The Syslog dataformat is used for working with RFC3164 and RFC5424 messages (logging and monitoring). | link:camel-tarfile/src/main/docs/tarfile-dataformat.adoc[Tar File] (camel-tarfile) | 2.16 | The Tar File data format is a message compression and de-compression format of tar files. @@ -964,8 +967,6 @@ Number of Data Formats: 45 in 35 JAR artifacts (0 deprecated) | link:camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc[YAML SnakeYAML] (camel-snakeyaml) | 2.17 | YAML is a data format to marshal and unmarshal Java objects to and from YAML. -| link:../camel-core/src/main/docs/zip-dataformat.adoc[Zip Deflate Compression] (camel-core) | 2.12 | Zip Deflate Compression data format is a message compression and de-compression format (not zip files). - | link:camel-zipfile/src/main/docs/zipfile-dataformat.adoc[Zip File] (camel-zipfile) | 2.11 | The Zip File data format is a message compression and de-compression format of zip files. |=== // dataformats: END @@ -974,24 +975,14 @@ Number of Data Formats: 45 in 35 JAR artifacts (0 deprecated) ==== Expression Languages // languages: START -Number of Languages: 18 in 9 JAR artifacts (1 deprecated) +Number of Languages: 8 in 8 JAR artifacts (1 deprecated) [width="100%",cols="4,1,5",options="header"] |=== | Language | Available From | Description -| link:../camel-core/src/main/docs/bean-language.adoc[Bean method] (camel-core) | 1.3 | To use a Java bean (aka method call) in Camel expressions or predicates. - -| link:../camel-core/src/main/docs/constant-language.adoc[Constant] (camel-core) | 1.5 | To use a constant value in Camel expressions or predicates. - -| link:../camel-core/src/main/docs/exchangeProperty-language.adoc[ExchangeProperty] (camel-core) | 2.0 | To use a Camel Exchange property in expressions or predicates. - -| link:../camel-core/src/main/docs/file-language.adoc[File] (camel-core) | 1.1 | For expressions and predicates using the file/simple language - | link:camel-groovy/src/main/docs/groovy-language.adoc[Groovy] (camel-groovy) | 1.3 | To use Groovy scripts in Camel expressions or predicates. -| link:../camel-core/src/main/docs/header-language.adoc[Header] (camel-core) | 1.5 | To use a Camel Message header in expressions or predicates. - | link:camel-hl7/src/main/docs/terser-language.adoc[HL7 Terser] (camel-hl7) | 2.11 | To use HL7 terser scripts in Camel expressions or predicates. | link:camel-script/src/main/docs/javaScript-language.adoc[JavaScript] (camel-script) | 1.0 | *deprecated* To use JavaScript in Camel expressions or predicates. @@ -1002,18 +993,8 @@ Number of Languages: 18 in 9 JAR artifacts (1 deprecated) | link:camel-ognl/src/main/docs/ognl-language.adoc[OGNL] (camel-ognl) | 1.1 | To use OGNL scripts in Camel expressions or predicates. -| link:../camel-core/src/main/docs/ref-language.adoc[Ref] (camel-core) | 2.8 | Reference to an existing Camel expression or predicate, which is looked up from the Camel registry. - -| link:../camel-core/src/main/docs/simple-language.adoc[Simple] (camel-core) | 1.1 | To use Camels built-in Simple language in Camel expressions or predicates. - | link:camel-spring/src/main/docs/spel-language.adoc[SpEL] (camel-spring) | 2.7 | To use Spring Expression Language (SpEL) in Camel expressions or predicates. -| link:../camel-core/src/main/docs/tokenize-language.adoc[Tokenize] (camel-core) | 2.0 | To use Camel message body or header with a tokenizer in Camel expressions or predicates. - -| link:../camel-core/src/main/docs/xtokenize-language.adoc[XML Tokenize] (camel-core) | 2.14 | To use Camel message body or header with a XML tokenizer in Camel expressions or predicates. - -| link:../camel-core/src/main/docs/xpath-language.adoc[XPath] (camel-core) | 1.1 | To use XPath (XML) in Camel expressions or predicates. - | link:camel-saxon/src/main/docs/xquery-language.adoc[XQuery] (camel-saxon) | 1.0 | To use XQuery (XML) in Camel expressions or predicates. |=== // languages: END diff --git a/parent/pom.xml b/parent/pom.xml index b083f7d..0f3a2bd 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -1840,6 +1840,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-saga</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-salesforce</artifactId> <version>${project.version}</version> </dependency> @@ -3179,6 +3184,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-saga-starter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-salesforce-starter</artifactId> <version>${project.version}</version> </dependency> diff --git a/platforms/spring-boot/components-starter/camel-saga-starter/pom.xml b/platforms/spring-boot/components-starter/camel-saga-starter/pom.xml new file mode 100644 index 0000000..54959e5 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-saga-starter/pom.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel</groupId> + <artifactId>components-starter</artifactId> + <version>3.0.0-SNAPSHOT</version> + </parent> + <artifactId>camel-saga-starter</artifactId> + <packaging>jar</packaging> + <name>Spring-Boot Starter :: Camel :: Saga</name> + <description>Spring-Boot Starter for Camel Saga component</description> + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter</artifactId> + <version>${spring-boot-version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-saga</artifactId> + <version>${project.version}</version> + </dependency> + <!--START OF GENERATED CODE--> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-core-starter</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-boot-starter</artifactId> + </dependency> + <!--END OF GENERATED CODE--> + </dependencies> +</project> diff --git a/platforms/spring-boot/components-starter/camel-saga-starter/src/main/java/org/apache/camel/component/saga/springboot/SagaComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-saga-starter/src/main/java/org/apache/camel/component/saga/springboot/SagaComponentAutoConfiguration.java new file mode 100644 index 0000000..7e00ec5 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-saga-starter/src/main/java/org/apache/camel/component/saga/springboot/SagaComponentAutoConfiguration.java @@ -0,0 +1,128 @@ +/** + * 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. + */ +package org.apache.camel.component.saga.springboot; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import org.apache.camel.CamelContext; +import org.apache.camel.component.saga.SagaComponent; +import org.apache.camel.spi.ComponentCustomizer; +import org.apache.camel.spi.HasId; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.GroupCondition; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.apache.camel.support.IntrospectionSupport; +import org.apache.camel.util.ObjectHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") +@Configuration +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SagaComponentAutoConfiguration.GroupConditions.class}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +@EnableConfigurationProperties({ComponentConfigurationProperties.class, + SagaComponentConfiguration.class}) +public class SagaComponentAutoConfiguration { + + private static final Logger LOGGER = LoggerFactory + .getLogger(SagaComponentAutoConfiguration.class); + @Autowired + private ApplicationContext applicationContext; + @Autowired + private CamelContext camelContext; + @Autowired + private SagaComponentConfiguration configuration; + @Autowired(required = false) + private List<ComponentCustomizer<SagaComponent>> customizers; + + static class GroupConditions extends GroupCondition { + public GroupConditions() { + super("camel.component", "camel.component.saga"); + } + } + + @Lazy + @Bean(name = "saga-component") + @ConditionalOnMissingBean(SagaComponent.class) + public SagaComponent configureSagaComponent() throws Exception { + SagaComponent component = new SagaComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + for (Map.Entry<String, Object> entry : parameters.entrySet()) { + Object value = entry.getValue(); + Class<?> paramClass = value.getClass(); + if (paramClass.getName().endsWith("NestedConfiguration")) { + Class nestedClass = null; + try { + nestedClass = (Class) paramClass.getDeclaredField( + "CAMEL_NESTED_CLASS").get(null); + HashMap<String, Object> nestedParameters = new HashMap<>(); + IntrospectionSupport.getProperties(value, nestedParameters, + null, false); + Object nestedProperty = nestedClass.newInstance(); + CamelPropertiesHelper.setCamelProperties(camelContext, + nestedProperty, nestedParameters, false); + entry.setValue(nestedProperty); + } catch (NoSuchFieldException e) { + } + } + } + CamelPropertiesHelper.setCamelProperties(camelContext, component, + parameters, false); + if (ObjectHelper.isNotEmpty(customizers)) { + for (ComponentCustomizer<SagaComponent> customizer : customizers) { + boolean useCustomizer = (customizer instanceof HasId) + ? HierarchicalPropertiesEvaluator.evaluate( + applicationContext.getEnvironment(), + "camel.component.customizer", + "camel.component.saga.customizer", + ((HasId) customizer).getId()) + : HierarchicalPropertiesEvaluator.evaluate( + applicationContext.getEnvironment(), + "camel.component.customizer", + "camel.component.saga.customizer"); + if (useCustomizer) { + LOGGER.debug("Configure component {}, with customizer {}", + component, customizer); + customizer.customize(component); + } + } + } + return component; + } +} \ No newline at end of file diff --git a/platforms/spring-boot/components-starter/camel-saga-starter/src/main/java/org/apache/camel/component/saga/springboot/SagaComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-saga-starter/src/main/java/org/apache/camel/component/saga/springboot/SagaComponentConfiguration.java new file mode 100644 index 0000000..889ced0 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-saga-starter/src/main/java/org/apache/camel/component/saga/springboot/SagaComponentConfiguration.java @@ -0,0 +1,55 @@ +/** + * 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. + */ +package org.apache.camel.component.saga.springboot; + +import javax.annotation.Generated; +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The saga component provides access to advanced options for managing the flow + * in the Saga EIP. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") +@ConfigurationProperties(prefix = "camel.component.saga") +public class SagaComponentConfiguration + extends + ComponentConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the saga component. This is + * enabled by default. + */ + private Boolean enabled; + /** + * Whether the component should resolve property placeholders on itself when + * starting. Only properties which are of String type can use property + * placeholders. + */ + private Boolean resolvePropertyPlaceholders = true; + + public Boolean getResolvePropertyPlaceholders() { + return resolvePropertyPlaceholders; + } + + public void setResolvePropertyPlaceholders( + Boolean resolvePropertyPlaceholders) { + this.resolvePropertyPlaceholders = resolvePropertyPlaceholders; + } +} \ No newline at end of file diff --git a/platforms/spring-boot/components-starter/camel-saga-starter/src/main/resources/META-INF/LICENSE.txt b/platforms/spring-boot/components-starter/camel-saga-starter/src/main/resources/META-INF/LICENSE.txt new file mode 100644 index 0000000..6b0b127 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-saga-starter/src/main/resources/META-INF/LICENSE.txt @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. + diff --git a/platforms/spring-boot/components-starter/camel-saga-starter/src/main/resources/META-INF/NOTICE.txt b/platforms/spring-boot/components-starter/camel-saga-starter/src/main/resources/META-INF/NOTICE.txt new file mode 100644 index 0000000..2e215bf --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-saga-starter/src/main/resources/META-INF/NOTICE.txt @@ -0,0 +1,11 @@ + ========================================================================= + == NOTICE file corresponding to the section 4 d of == + == the Apache License, Version 2.0, == + == in this case for the Apache Camel distribution. == + ========================================================================= + + This product includes software developed by + The Apache Software Foundation (http://www.apache.org/). + + Please read the different LICENSE files present in the licenses directory of + this distribution. diff --git a/platforms/spring-boot/components-starter/camel-saga-starter/src/main/resources/META-INF/spring.factories b/platforms/spring-boot/components-starter/camel-saga-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..1ddf02f --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-saga-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.saga.springboot.SagaComponentAutoConfiguration diff --git a/platforms/spring-boot/components-starter/camel-saga-starter/src/main/resources/META-INF/spring.provides b/platforms/spring-boot/components-starter/camel-saga-starter/src/main/resources/META-INF/spring.provides new file mode 100644 index 0000000..7602fa4 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-saga-starter/src/main/resources/META-INF/spring.provides @@ -0,0 +1,17 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- +provides: camel-saga diff --git a/platforms/spring-boot/components-starter/pom.xml b/platforms/spring-boot/components-starter/pom.xml index d6b8232..03879c8 100644 --- a/platforms/spring-boot/components-starter/pom.xml +++ b/platforms/spring-boot/components-starter/pom.xml @@ -284,6 +284,7 @@ <module>camel-rmi-starter</module> <module>camel-rss-starter</module> <module>camel-rxjava2-starter</module> + <module>camel-saga-starter</module> <module>camel-salesforce-starter</module> <module>camel-sap-netweaver-starter</module> <module>camel-saxon-starter</module>