You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/03/16 09:49:02 UTC
[2/2] camel git commit: CAMEL-10799: generate spring boot auto
configuration for connectors
CAMEL-10799: generate spring boot auto configuration for connectors
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2467a192
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2467a192
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2467a192
Branch: refs/heads/master
Commit: 2467a1920c23686043a7e73df1ce449cbedce819
Parents: 5f1a832
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Mar 16 10:37:53 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Mar 16 10:42:38 2017 +0100
----------------------------------------------------------------------
.../src/main/docs/connector-component.adoc | 56 ++++++++++----
connectors/examples/bar-connector/pom.xml | 14 +++-
connectors/examples/foo-connector/pom.xml | 14 +++-
.../salesforce-upsert-contact-connector/pom.xml | 23 ++++++
...UpsertContactConnectorAutoConfiguration.java | 60 +++++++++++++++
...orceUpsertContactConnectorConfiguration.java | 78 ++++++++++++++++++++
.../main/resources/META-INF/spring.factories | 19 +++++
.../src/main/resources/camel-connector.json | 1 +
.../examples/twitter-mention-connector/pom.xml | 15 +++-
...witterMentionConnectorAutoConfiguration.java | 60 +++++++++++++++
.../TwitterMentionConnectorConfiguration.java | 78 ++++++++++++++++++++
.../main/resources/META-INF/spring.factories | 19 +++++
.../src/main/resources/camel-connector.json | 1 +
.../src/main/resources/application.properties | 18 ++---
connectors/examples/wine-connector/pom.xml | 14 +++-
15 files changed, 436 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/camel-connector/src/main/docs/connector-component.adoc
----------------------------------------------------------------------
diff --git a/connectors/camel-connector/src/main/docs/connector-component.adoc b/connectors/camel-connector/src/main/docs/connector-component.adoc
index 5531aa7..f3f1e67 100644
--- a/connectors/camel-connector/src/main/docs/connector-component.adoc
+++ b/connectors/camel-connector/src/main/docs/connector-component.adoc
@@ -65,24 +65,47 @@ To build a connector you need to at least include the following dependencies in
</dependency>
------------
-And then the `camel-connector-maven-plugin` plugin as well:
+And these following Maven plugins:
[source,xml]
------------
- <!-- generate connector -->
- <plugin>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-connector-maven-plugin</artifactId>
- <version>${camel.version}</version>
- <executions>
- <execution>
- <id>connector</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <!-- generate components meta-data and validate component includes documentation etc -->
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-package-maven-plugin</artifactId>
+ <version>${project.version}</version>
+ <executions>
+ <execution>
+ <id>prepare</id>
+ <goals>
+ <goal>prepare-components</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ </execution>
+ <execution>
+ <id>validate</id>
+ <goals>
+ <goal>validate-components</goal>
+ </goals>
+ <phase>prepare-package</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- generate connector -->
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-connector-maven-plugin</artifactId>
+ <version>${camel.version}</version>
+ <executions>
+ <execution>
+ <id>connector</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
------------
@@ -96,7 +119,8 @@ A Camel connector works great with Spring Boot. If a connector has been configur
Then the `camel-connector-maven-plugin` will be able to generate Spring Boot auto configuration for these options.
This allows users to essily configure these options if using Spring Boot with the connector.
-To enable Spring Boot generation you need to enable this in the `camel-connector-maven-plugin` as follows:
+To enable Spring Boot generation you need to enable this in the `camel-connector-maven-plugin` by adding
+an `<execution>` with the `prepare-spring-boot-auto-configuration` goal:
[source,xml]
------------
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/bar-connector/pom.xml
----------------------------------------------------------------------
diff --git a/connectors/examples/bar-connector/pom.xml b/connectors/examples/bar-connector/pom.xml
index feb962d..3fc5a11 100644
--- a/connectors/examples/bar-connector/pom.xml
+++ b/connectors/examples/bar-connector/pom.xml
@@ -62,11 +62,15 @@
<version>${project.version}</version>
</dependency>
- <!-- support camel documentation -->
+ <!-- camel and spring boot compiler plugins -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>apt</artifactId>
- <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-configuration-processor</artifactId>
+ <version>${spring-boot-version}</version>
</dependency>
<!-- logging -->
@@ -161,6 +165,12 @@
<version>${project.version}</version>
<executions>
<execution>
+ <id>boot</id>
+ <goals>
+ <goal>prepare-spring-boot-auto-configuration</goal>
+ </goals>
+ </execution>
+ <execution>
<id>connector</id>
<goals>
<goal>jar</goal>
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/foo-connector/pom.xml
----------------------------------------------------------------------
diff --git a/connectors/examples/foo-connector/pom.xml b/connectors/examples/foo-connector/pom.xml
index 3783ad2..54ae198 100644
--- a/connectors/examples/foo-connector/pom.xml
+++ b/connectors/examples/foo-connector/pom.xml
@@ -62,11 +62,15 @@
<version>${project.version}</version>
</dependency>
- <!-- support camel documentation -->
+ <!-- camel and spring boot compiler plugins -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>apt</artifactId>
- <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-configuration-processor</artifactId>
+ <version>${spring-boot-version}</version>
</dependency>
<!-- logging -->
@@ -161,6 +165,12 @@
<version>${project.version}</version>
<executions>
<execution>
+ <id>boot</id>
+ <goals>
+ <goal>prepare-spring-boot-auto-configuration</goal>
+ </goals>
+ </execution>
+ <execution>
<id>connector</id>
<goals>
<goal>jar</goal>
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/salesforce-upsert-contact-connector/pom.xml
----------------------------------------------------------------------
diff --git a/connectors/examples/salesforce-upsert-contact-connector/pom.xml b/connectors/examples/salesforce-upsert-contact-connector/pom.xml
index 10a9e27..4144a79 100644
--- a/connectors/examples/salesforce-upsert-contact-connector/pom.xml
+++ b/connectors/examples/salesforce-upsert-contact-connector/pom.xml
@@ -36,6 +36,8 @@
</properties>
<dependencies>
+
+ <!-- base component to use for this connector -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-salesforce</artifactId>
@@ -44,10 +46,23 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-salesforce-starter</artifactId>
</dependency>
+
+ <!-- camel-connector -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-connector</artifactId>
</dependency>
+
+ <!-- camel and spring boot compiler plugins -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>apt</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-configuration-processor</artifactId>
+ <version>${spring-boot-version}</version>
+ </dependency>
</dependencies>
<build>
@@ -72,6 +87,8 @@
</executions>
</plugin>
+ <!-- this is needed due Apache Camel source code uses the OSGi plugin to build JARs -->
+ <!-- for end users whom create connectors you would not have this problem -->
<!-- turn off jar plugin as we use connector plugin to jar instead -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -92,6 +109,12 @@
<version>${project.version}</version>
<executions>
<execution>
+ <id>boot</id>
+ <goals>
+ <goal>prepare-spring-boot-auto-configuration</goal>
+ </goals>
+ </execution>
+ <execution>
<id>connector</id>
<goals>
<goal>jar</goal>
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/salesforce-upsert-contact-connector/src/main/java/org/foo/salesforce/contact/springboot/SalesforceUpsertContactConnectorAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/connectors/examples/salesforce-upsert-contact-connector/src/main/java/org/foo/salesforce/contact/springboot/SalesforceUpsertContactConnectorAutoConfiguration.java b/connectors/examples/salesforce-upsert-contact-connector/src/main/java/org/foo/salesforce/contact/springboot/SalesforceUpsertContactConnectorAutoConfiguration.java
new file mode 100644
index 0000000..c9045ed
--- /dev/null
+++ b/connectors/examples/salesforce-upsert-contact-connector/src/main/java/org/foo/salesforce/contact/springboot/SalesforceUpsertContactConnectorAutoConfiguration.java
@@ -0,0 +1,60 @@
+/**
+ * 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.foo.salesforce.contact.springboot;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.camel.CamelContext;
+import org.apache.camel.util.IntrospectionSupport;
+import org.foo.salesforce.contact.SalesforceUpsertContactComponent;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
+
+/**
+ * Generated by camel-connector-maven-plugin - do not edit this file!
+ */
+@Configuration
+@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@EnableConfigurationProperties(SalesforceUpsertContactConnectorConfiguration.class)
+public class SalesforceUpsertContactConnectorAutoConfiguration {
+
+ @Lazy
+ @Bean(name = "salesforce-upsert-contact-component")
+ @ConditionalOnClass(CamelContext.class)
+ @ConditionalOnMissingBean(org.foo.salesforce.contact.SalesforceUpsertContactComponent.class)
+ public SalesforceUpsertContactComponent configureSalesforceUpsertContactComponent(
+ CamelContext camelContext,
+ SalesforceUpsertContactConnectorConfiguration configuration)
+ throws Exception {
+ SalesforceUpsertContactComponent connector = new SalesforceUpsertContactComponent();
+ connector.setCamelContext(camelContext);
+ Map<String, Object> parameters = new HashMap<>();
+ IntrospectionSupport.getProperties(configuration, parameters, null,
+ false);
+ IntrospectionSupport.setProperties(camelContext,
+ camelContext.getTypeConverter(), connector, parameters);
+ connector.setComponentOptions(parameters);
+ return connector;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/salesforce-upsert-contact-connector/src/main/java/org/foo/salesforce/contact/springboot/SalesforceUpsertContactConnectorConfiguration.java
----------------------------------------------------------------------
diff --git a/connectors/examples/salesforce-upsert-contact-connector/src/main/java/org/foo/salesforce/contact/springboot/SalesforceUpsertContactConnectorConfiguration.java b/connectors/examples/salesforce-upsert-contact-connector/src/main/java/org/foo/salesforce/contact/springboot/SalesforceUpsertContactConnectorConfiguration.java
new file mode 100644
index 0000000..12dc735
--- /dev/null
+++ b/connectors/examples/salesforce-upsert-contact-connector/src/main/java/org/foo/salesforce/contact/springboot/SalesforceUpsertContactConnectorConfiguration.java
@@ -0,0 +1,78 @@
+/**
+ * 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.foo.salesforce.contact.springboot;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * The salesforce connector is used for integrating Camel with the massive
+ * Salesforce API.
+ *
+ * Generated by camel-connector-maven-plugin - do not edit this file!
+ */
+@ConfigurationProperties(prefix = "camel.connector.salesforce-upsert-contact")
+public class SalesforceUpsertContactConnectorConfiguration {
+
+ /**
+ * Salesforce login URL defaults to https://login.salesforce.com
+ */
+ private String loginUrl = "https://login.salesforce.com";
+ /**
+ * Salesforce connected application Consumer Key
+ */
+ private String clientId;
+ /**
+ * Salesforce connected application Consumer Secret
+ */
+ private String clientSecret;
+ /**
+ * Salesforce connected application Consumer token
+ */
+ private String refreshToken;
+
+ public String getLoginUrl() {
+ return loginUrl;
+ }
+
+ public void setLoginUrl(String loginUrl) {
+ this.loginUrl = loginUrl;
+ }
+
+ public String getClientId() {
+ return clientId;
+ }
+
+ public void setClientId(String clientId) {
+ this.clientId = clientId;
+ }
+
+ public String getClientSecret() {
+ return clientSecret;
+ }
+
+ public void setClientSecret(String clientSecret) {
+ this.clientSecret = clientSecret;
+ }
+
+ public String getRefreshToken() {
+ return refreshToken;
+ }
+
+ public void setRefreshToken(String refreshToken) {
+ this.refreshToken = refreshToken;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/META-INF/spring.factories
----------------------------------------------------------------------
diff --git a/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/META-INF/spring.factories b/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/META-INF/spring.factories
new file mode 100644
index 0000000..f4c57c0
--- /dev/null
+++ b/connectors/examples/salesforce-upsert-contact-connector/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.foo.salesforce.contact.springboot.SalesforceUpsertContactConnectorAutoConfiguration
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/camel-connector.json
----------------------------------------------------------------------
diff --git a/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/camel-connector.json b/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/camel-connector.json
index 0b6d1f8..1e009ab 100644
--- a/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/camel-connector.json
+++ b/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/camel-connector.json
@@ -3,6 +3,7 @@
"baseGroupId": "org.apache.camel",
"baseArtifactId": "camel-salesforce",
"baseVersion": "2.19.0-SNAPSHOT",
+ "baseJavaType": "org.apache.camel.component.salesforce.SalesforceComponent",
"name": "SalesforceUpsertContact",
"scheme": "salesforce-upsert-contact",
"javaType": "org.foo.salesforce.contact.SalesforceUpsertContactComponent",
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/twitter-mention-connector/pom.xml
----------------------------------------------------------------------
diff --git a/connectors/examples/twitter-mention-connector/pom.xml b/connectors/examples/twitter-mention-connector/pom.xml
index 648d04a..0f72a65 100644
--- a/connectors/examples/twitter-mention-connector/pom.xml
+++ b/connectors/examples/twitter-mention-connector/pom.xml
@@ -54,7 +54,6 @@
<artifactId>camel-twitter</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- add spring-boot support -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-twitter-starter</artifactId>
@@ -68,11 +67,15 @@
<version>${project.version}</version>
</dependency>
- <!-- support camel documentation -->
+ <!-- camel and spring boot compiler plugins -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>apt</artifactId>
- <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-configuration-processor</artifactId>
+ <version>${spring-boot-version}</version>
</dependency>
<!-- logging -->
@@ -167,6 +170,12 @@
<version>${project.version}</version>
<executions>
<execution>
+ <id>boot</id>
+ <goals>
+ <goal>prepare-spring-boot-auto-configuration</goal>
+ </goals>
+ </execution>
+ <execution>
<id>connector</id>
<goals>
<goal>jar</goal>
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/twitter-mention-connector/src/main/java/org/foo/mention/springboot/TwitterMentionConnectorAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/connectors/examples/twitter-mention-connector/src/main/java/org/foo/mention/springboot/TwitterMentionConnectorAutoConfiguration.java b/connectors/examples/twitter-mention-connector/src/main/java/org/foo/mention/springboot/TwitterMentionConnectorAutoConfiguration.java
new file mode 100644
index 0000000..f3f4dd6
--- /dev/null
+++ b/connectors/examples/twitter-mention-connector/src/main/java/org/foo/mention/springboot/TwitterMentionConnectorAutoConfiguration.java
@@ -0,0 +1,60 @@
+/**
+ * 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.foo.mention.springboot;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.camel.CamelContext;
+import org.apache.camel.util.IntrospectionSupport;
+import org.foo.mention.TwitterMentionComponent;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
+
+/**
+ * Generated by camel-connector-maven-plugin - do not edit this file!
+ */
+@Configuration
+@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@EnableConfigurationProperties(TwitterMentionConnectorConfiguration.class)
+public class TwitterMentionConnectorAutoConfiguration {
+
+ @Lazy
+ @Bean(name = "twitter-mention-component")
+ @ConditionalOnClass(CamelContext.class)
+ @ConditionalOnMissingBean(org.foo.mention.TwitterMentionComponent.class)
+ public TwitterMentionComponent configureTwitterMentionComponent(
+ CamelContext camelContext,
+ TwitterMentionConnectorConfiguration configuration)
+ throws Exception {
+ TwitterMentionComponent connector = new TwitterMentionComponent();
+ connector.setCamelContext(camelContext);
+ Map<String, Object> parameters = new HashMap<>();
+ IntrospectionSupport.getProperties(configuration, parameters, null,
+ false);
+ IntrospectionSupport.setProperties(camelContext,
+ camelContext.getTypeConverter(), connector, parameters);
+ connector.setComponentOptions(parameters);
+ return connector;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/twitter-mention-connector/src/main/java/org/foo/mention/springboot/TwitterMentionConnectorConfiguration.java
----------------------------------------------------------------------
diff --git a/connectors/examples/twitter-mention-connector/src/main/java/org/foo/mention/springboot/TwitterMentionConnectorConfiguration.java b/connectors/examples/twitter-mention-connector/src/main/java/org/foo/mention/springboot/TwitterMentionConnectorConfiguration.java
new file mode 100644
index 0000000..abddbf3
--- /dev/null
+++ b/connectors/examples/twitter-mention-connector/src/main/java/org/foo/mention/springboot/TwitterMentionConnectorConfiguration.java
@@ -0,0 +1,78 @@
+/**
+ * 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.foo.mention.springboot;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * This connector integrates with Twitter to send tweets or search for tweets
+ * and more.
+ *
+ * Generated by camel-connector-maven-plugin - do not edit this file!
+ */
+@ConfigurationProperties(prefix = "camel.connector.twitter-mention")
+public class TwitterMentionConnectorConfiguration {
+
+ /**
+ * The access token
+ */
+ private String accessToken;
+ /**
+ * The access token secret
+ */
+ private String accessTokenSecret;
+ /**
+ * The consumer key
+ */
+ private String consumerKey;
+ /**
+ * The consumer secret
+ */
+ private String consumerSecret;
+
+ public String getAccessToken() {
+ return accessToken;
+ }
+
+ public void setAccessToken(String accessToken) {
+ this.accessToken = accessToken;
+ }
+
+ public String getAccessTokenSecret() {
+ return accessTokenSecret;
+ }
+
+ public void setAccessTokenSecret(String accessTokenSecret) {
+ this.accessTokenSecret = accessTokenSecret;
+ }
+
+ public String getConsumerKey() {
+ return consumerKey;
+ }
+
+ public void setConsumerKey(String consumerKey) {
+ this.consumerKey = consumerKey;
+ }
+
+ public String getConsumerSecret() {
+ return consumerSecret;
+ }
+
+ public void setConsumerSecret(String consumerSecret) {
+ this.consumerSecret = consumerSecret;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/twitter-mention-connector/src/main/resources/META-INF/spring.factories
----------------------------------------------------------------------
diff --git a/connectors/examples/twitter-mention-connector/src/main/resources/META-INF/spring.factories b/connectors/examples/twitter-mention-connector/src/main/resources/META-INF/spring.factories
new file mode 100644
index 0000000..4eec7b4
--- /dev/null
+++ b/connectors/examples/twitter-mention-connector/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.foo.mention.springboot.TwitterMentionConnectorAutoConfiguration
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/twitter-mention-connector/src/main/resources/camel-connector.json
----------------------------------------------------------------------
diff --git a/connectors/examples/twitter-mention-connector/src/main/resources/camel-connector.json b/connectors/examples/twitter-mention-connector/src/main/resources/camel-connector.json
index 53087f5..7bc0095 100644
--- a/connectors/examples/twitter-mention-connector/src/main/resources/camel-connector.json
+++ b/connectors/examples/twitter-mention-connector/src/main/resources/camel-connector.json
@@ -3,6 +3,7 @@
"baseGroupId": "org.apache.camel",
"baseArtifactId": "camel-twitter",
"baseVersion": "2.19.0-SNAPSHOT",
+ "baseJavaType": "org.apache.camel.component.twitter.TwitterComponent",
"name": "TwitterMention",
"scheme": "twitter-mention",
"javaType": "org.foo.mention.TwitterMentionComponent",
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/twitter-salesforce-example/src/main/resources/application.properties
----------------------------------------------------------------------
diff --git a/connectors/examples/twitter-salesforce-example/src/main/resources/application.properties b/connectors/examples/twitter-salesforce-example/src/main/resources/application.properties
index 978d776..08078d5 100644
--- a/connectors/examples/twitter-salesforce-example/src/main/resources/application.properties
+++ b/connectors/examples/twitter-salesforce-example/src/main/resources/application.properties
@@ -4,18 +4,18 @@ camel.springboot.name=mention
## This uses the Twitter 'cameltweet' account for testing purposes.
## do NOT use this twitter account in your applications!
-camel.component.twitter.consumer-key=NMqaca1bzXsOcZhP2XlwA
-camel.component.twitter.consumer-secret=VxNQiRLwwKVD0K9mmfxlTTbVdgRpriORypnUbHhxeQw
-camel.component.twitter.access-token=26693234-W0YjxL9cMJrC0VZZ4xdgFMymxIQ10LeL1K8YlbBY
-camel.component.twitter.access-token-secret=BZD51BgzbOdFstWZYsqB5p5dbuuDV12vrOdatzhY4E
+camel.connector.twitter-mention.consumer-key=NMqaca1bzXsOcZhP2XlwA
+camel.connector.twitter-mention.consumer-secret=VxNQiRLwwKVD0K9mmfxlTTbVdgRpriORypnUbHhxeQw
+camel.connector.twitter-mention.access-token=26693234-W0YjxL9cMJrC0VZZ4xdgFMymxIQ10LeL1K8YlbBY
+camel.connector.twitter-mention.access-token-secret=BZD51BgzbOdFstWZYsqB5p5dbuuDV12vrOdatzhY4E
## Consumer Key of the connected application
-camel.component.salesforce.clientId=3MVG9szVa2RxsqBZXHfqsW3hf9HQp_N6qdSmpjKMzSJaEL4UP161JlDkE32EigL82ra_jM1WuQgF4rYDgzL3u
+camel.connector.salesforce-upsert-contact.clientId=3MVG9szVa2RxsqBZXHfqsW3hf9HQp_N6qdSmpjKMzSJaEL4UP161JlDkE32EigL82ra_jM1WuQgF4rYDgzL3u
## Consumer Secret of the connected application
-camel.component.salesforce.clientSecret=1039611643161946846
+camel.connector.salesforce-upsert-contact.clientSecret=1039611643161946846
## refresh_token from OAuth flow
-camel.component.salesforce.refreshToken=5Aep861HDR3iASSXIX6hI7M1qMWSCs1Ym57WUH1ftjE7RvnM7MvnAXx9EZaw_HIoNCKktNsuhx.xwjLThofuJH4
+camel.connector.salesforce-upsert-contact.refreshToken=5Aep861HDR3iASSXIX6hI7M1qMWSCs1Ym57WUH1ftjE7RvnM7MvnAXx9EZaw_HIoNCKktNsuhx.xwjLThofuJH4
## you can also use:
-#camel.component.salesforce.userName=<Salesforce username>
-#camel.component.salesforce.password=<Salesforce password>
+#camel.connector.salesforce-upsert-contact.userName=<Salesforce username>
+#camel.connector.salesforce-upsert-contact.password=<Salesforce password>
http://git-wip-us.apache.org/repos/asf/camel/blob/2467a192/connectors/examples/wine-connector/pom.xml
----------------------------------------------------------------------
diff --git a/connectors/examples/wine-connector/pom.xml b/connectors/examples/wine-connector/pom.xml
index b827538..fe75e6c 100644
--- a/connectors/examples/wine-connector/pom.xml
+++ b/connectors/examples/wine-connector/pom.xml
@@ -62,11 +62,15 @@
<version>${project.version}</version>
</dependency>
- <!-- support camel documentation -->
+ <!-- camel and spring boot compiler plugins -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>apt</artifactId>
- <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-configuration-processor</artifactId>
+ <version>${spring-boot-version}</version>
</dependency>
<!-- logging -->
@@ -161,6 +165,12 @@
<version>${project.version}</version>
<executions>
<execution>
+ <id>boot</id>
+ <goals>
+ <goal>prepare-spring-boot-auto-configuration</goal>
+ </goals>
+ </execution>
+ <execution>
<id>connector</id>
<goals>
<goal>jar</goal>