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 2023/02/26 19:40:29 UTC

[camel-spring-boot] branch main updated (81a03f838c7 -> ad5c8e42519)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


    from 81a03f838c7 CAMEL-19090: Remove deprecated apis in core
     new 12d434bfeb3 Regen
     new 72a1092692b CAMEL-15105: decouple the ExtendedCamelContext from the CamelContext
     new ad5c8e42519 CAMEL-19090: Remove deprecated apis in core

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel/springboot/catalog/components/language.json    |  1 +
 .../apache/camel/component/fhir/FhirConfigurationIT.java |  2 +-
 .../file/remote/springboot/AbstractBaseFtp.java          |  5 ++---
 .../apache/camel/spring/boot/CamelAutoConfiguration.java | 16 ++++++++--------
 .../spring/boot/CamelSpringBootApplicationListener.java  |  2 +-
 .../camel/spring/boot/LogListenerDiscoveryTest.java      |  2 +-
 6 files changed, 14 insertions(+), 14 deletions(-)


[camel-spring-boot] 01/03: Regen

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit 12d434bfeb3ad81b6f9d573df74b84b25e055413
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Feb 26 20:35:04 2023 +0100

    Regen
---
 .../org/apache/camel/springboot/catalog/components/language.json         | 1 +
 1 file changed, 1 insertion(+)

diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/language.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/language.json
index e7d285389a2..0146025bb2d 100644
--- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/language.json
+++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/language.json
@@ -35,6 +35,7 @@
     "binary": { "kind": "parameter", "displayName": "Binary", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the script is binary content or text content. By default the script is read as text content (eg java.lang.String)" },
     "cacheScript": { "kind": "parameter", "displayName": "Cache Script", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to cache the compiled script and reuse Notice reusing the script can cause side effects from processing one Camel org.apache.camel.Exchange to the next org.apache.camel.Exchange." },
     "contentCache": { "kind": "parameter", "displayName": "Content Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Sets whether to use resource content cache or not" },
+    "resultType": { "kind": "parameter", "displayName": "Result Type", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the class of the result type (type from output)" },
     "script": { "kind": "parameter", "displayName": "Script", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the script to execute" },
     "transform": { "kind": "parameter", "displayName": "Transform", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether or not the result of the script should be used as message body. This options is default true." },
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may other [...]


[camel-spring-boot] 02/03: CAMEL-15105: decouple the ExtendedCamelContext from the CamelContext

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit 72a1092692b98769b269b1457e5c8dba780685f1
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Feb 26 20:39:03 2023 +0100

    CAMEL-15105: decouple the ExtendedCamelContext from the CamelContext
---
 .../apache/camel/component/fhir/FhirConfigurationIT.java |  2 +-
 .../apache/camel/spring/boot/CamelAutoConfiguration.java | 16 ++++++++--------
 .../spring/boot/CamelSpringBootApplicationListener.java  |  2 +-
 .../camel/spring/boot/LogListenerDiscoveryTest.java      |  2 +-
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/components-starter/camel-fhir-starter/src/test/java/org/apache/camel/component/fhir/FhirConfigurationIT.java b/components-starter/camel-fhir-starter/src/test/java/org/apache/camel/component/fhir/FhirConfigurationIT.java
index 07fa948eda5..51dc2b89a45 100644
--- a/components-starter/camel-fhir-starter/src/test/java/org/apache/camel/component/fhir/FhirConfigurationIT.java
+++ b/components-starter/camel-fhir-starter/src/test/java/org/apache/camel/component/fhir/FhirConfigurationIT.java
@@ -103,7 +103,7 @@ public class FhirConfigurationIT extends AbstractFhirTestSupport {
 
         assertTrue(interceptors.contains(this.mockClientInterceptor), "User defined IClientInterceptor not found");
 
-        long counter = camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().getInvokedCounter();
+        long counter = camelContext.getCamelContextExtension().getBeanIntrospection().getInvokedCounter();
         assertEquals(0, counter, "Should not use reflection");
     }
 
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
index 928b818ce8c..567ddc6a602 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
@@ -86,7 +86,7 @@ public class CamelAutoConfiguration {
         CamelContext camelContext = new SpringBootCamelContext(applicationContext, config.isWarnOnEarlyShutdown());
         // bean post processor is created before CamelContext
         beanPostProcessor.setCamelContext(camelContext);
-        camelContext.adapt(ExtendedCamelContext.class).setBeanPostProcessor(beanPostProcessor);
+        camelContext.getCamelContextExtension().setBeanPostProcessor(beanPostProcessor);
         return doConfigureCamelContext(applicationContext, camelContext, config);
     }
 
@@ -119,7 +119,7 @@ public class CamelAutoConfiguration {
             // sort by ordered
             OrderComparator.sort(reps);
             // and plugin as new registry
-            camelContext.adapt(ExtendedCamelContext.class).setRegistry(new DefaultRegistry(reps));
+            camelContext.getCamelContextExtension().setRegistry(new DefaultRegistry(reps));
         }
 
         if (ObjectHelper.isNotEmpty(config.getFileConfigurations())) {
@@ -135,8 +135,8 @@ public class CamelAutoConfiguration {
         // setup cli connector eager
         configureCliConnector(applicationContext, camelContext);
 
-        camelContext.adapt(ExtendedCamelContext.class).setPackageScanClassResolver(new FatJarPackageScanClassResolver());
-        camelContext.adapt(ExtendedCamelContext.class).setPackageScanResourceResolver(new FatJarPackageScanResourceResolver());
+        camelContext.getCamelContextExtension().setPackageScanClassResolver(new FatJarPackageScanClassResolver());
+        camelContext.getCamelContextExtension().setPackageScanResourceResolver(new FatJarPackageScanResourceResolver());
 
         if (config.getRouteFilterIncludePattern() != null || config.getRouteFilterExcludePattern() != null) {
             LOG.info("Route filtering pattern: include={}, exclude={}", config.getRouteFilterIncludePattern(), config.getRouteFilterExcludePattern());
@@ -173,13 +173,13 @@ public class CamelAutoConfiguration {
 
     static void configureStartupRecorder(CamelContext camelContext, CamelConfigurationProperties config) {
         if ("false".equals(config.getStartupRecorder())) {
-            camelContext.adapt(ExtendedCamelContext.class).getStartupStepRecorder().setEnabled(false);
+            camelContext.getCamelContextExtension().getStartupStepRecorder().setEnabled(false);
         } else if ("logging".equals(config.getStartupRecorder())) {
-            camelContext.adapt(ExtendedCamelContext.class).setStartupStepRecorder(new LoggingStartupStepRecorder());
+            camelContext.getCamelContextExtension().setStartupStepRecorder(new LoggingStartupStepRecorder());
         } else if ("java-flight-recorder".equals(config.getStartupRecorder())
                 || config.getStartupRecorder() == null) {
             // try to auto discover camel-jfr to use
-            StartupStepRecorder fr = camelContext.adapt(ExtendedCamelContext.class).getBootstrapFactoryFinder()
+            StartupStepRecorder fr = camelContext.getCamelContextExtension().getBootstrapFactoryFinder()
                     .newInstance(StartupStepRecorder.FACTORY, StartupStepRecorder.class).orElse(null);
             if (fr != null) {
                 LOG.debug("Discovered startup recorder: {} from classpath", fr);
@@ -187,7 +187,7 @@ public class CamelAutoConfiguration {
                 fr.setStartupRecorderDuration(config.getStartupRecorderDuration());
                 fr.setRecordingProfile(config.getStartupRecorderProfile());
                 fr.setMaxDepth(config.getStartupRecorderMaxDepth());
-                camelContext.adapt(ExtendedCamelContext.class).setStartupStepRecorder(fr);
+                camelContext.getCamelContextExtension().setStartupStepRecorder(fr);
             }
         }
     }
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
index 0befad2cf72..6bca0e8ecb5 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
@@ -98,7 +98,7 @@ public class CamelSpringBootApplicationListener implements ApplicationListener<C
                     configurer.setRoutesCollector(springBootRoutesCollector);
                 }
 
-                configurer.setBeanPostProcessor(camelContext.adapt(ExtendedCamelContext.class).getBeanPostProcessor());
+                configurer.setBeanPostProcessor(camelContext.getCamelContextExtension().getBeanPostProcessor());
                 configurer.setJavaRoutesExcludePattern(configurationProperties.getJavaRoutesExcludePattern());
                 configurer.setJavaRoutesIncludePattern(configurationProperties.getJavaRoutesIncludePattern());
                 configurer.setRoutesExcludePattern(configurationProperties.getRoutesExcludePattern());
diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/LogListenerDiscoveryTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/LogListenerDiscoveryTest.java
index a81151bb0c9..c27b2ed8616 100644
--- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/LogListenerDiscoveryTest.java
+++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/LogListenerDiscoveryTest.java
@@ -46,7 +46,7 @@ public class LogListenerDiscoveryTest {
 
     @Test
     public void testUuidDiscovery() {
-        assertThat(camelContext.adapt(ExtendedCamelContext.class).getLogListeners()).contains(logListener);
+        assertThat(camelContext.getCamelContextExtension().getLogListeners()).contains(logListener);
     }
 
     @Component


[camel-spring-boot] 03/03: CAMEL-19090: Remove deprecated apis in core

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit ad5c8e425191b1c2d7943a9f511a0c62494f749f
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Feb 26 20:39:20 2023 +0100

    CAMEL-19090: Remove deprecated apis in core
---
 .../camel/component/file/remote/springboot/AbstractBaseFtp.java      | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/AbstractBaseFtp.java b/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/AbstractBaseFtp.java
index 1d0c07418e8..294c349aab2 100644
--- a/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/AbstractBaseFtp.java
+++ b/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/AbstractBaseFtp.java
@@ -20,6 +20,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.model.language.SimpleExpression;
 import org.junit.jupiter.api.Assertions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
@@ -31,8 +32,6 @@ import java.nio.file.LinkOption;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
-import static org.apache.camel.language.simple.SimpleLanguage.simple;
-
 public abstract class AbstractBaseFtp {
     protected static final String AUTH_VALUE_SSL = "SSLv3";
     protected static final String AUTH_VALUE_TLS = "TLSv1.3";
@@ -50,7 +49,7 @@ public abstract class AbstractBaseFtp {
     }
 
     protected void sendFile(String url, Object body, String fileName) {
-        template.sendBodyAndHeader(url, body, Exchange.FILE_NAME, simple(fileName));
+        template.sendBodyAndHeader(url, body, Exchange.FILE_NAME, new SimpleExpression(fileName));
     }
 
     protected static void assertFileExists(String filename) {