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 2020/11/05 14:48:00 UTC

[camel-examples] branch master updated: Tiny example in lightweight mode

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-examples.git


The following commit(s) were added to refs/heads/master by this push:
     new 0bab4d7  Tiny example in lightweight mode
0bab4d7 is described below

commit 0bab4d7fefe9396df025e38e04e5c422b76be2b4
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Nov 5 15:47:44 2020 +0100

    Tiny example in lightweight mode
---
 .../org/apache/camel/example/MyBeanConfigurer.java |  9 +++++++
 .../services/org/apache/camel/configurer/MyBean    |  2 --
 .../src/main/resources/application.properties      | 28 ++++++----------------
 3 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/examples/camel-example-main-tiny/src/generated/java/org/apache/camel/example/MyBeanConfigurer.java b/examples/camel-example-main-tiny/src/generated/java/org/apache/camel/example/MyBeanConfigurer.java
index 4561ab5..33257bc 100644
--- a/examples/camel-example-main-tiny/src/generated/java/org/apache/camel/example/MyBeanConfigurer.java
+++ b/examples/camel-example-main-tiny/src/generated/java/org/apache/camel/example/MyBeanConfigurer.java
@@ -4,6 +4,7 @@ package org.apache.camel.example;
 import java.util.Map;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.spi.ConfigurerStrategy;
 import org.apache.camel.spi.GeneratedPropertyConfigurer;
 import org.apache.camel.spi.PropertyConfigurerGetter;
 import org.apache.camel.util.CaseInsensitiveMap;
@@ -20,6 +21,7 @@ public class MyBeanConfigurer extends org.apache.camel.support.component.Propert
         Map<String, Object> map = new CaseInsensitiveMap();
         map.put("Hi", java.lang.String.class);
         ALL_OPTIONS = map;
+        ConfigurerStrategy.addConfigurerClearer(MyBeanConfigurer::clearConfigurers);
     }
 
     @Override
@@ -37,6 +39,13 @@ public class MyBeanConfigurer extends org.apache.camel.support.component.Propert
         return ALL_OPTIONS;
     }
 
+    public static void clearBootstrapConfigurers() {
+    }
+
+    public static void clearConfigurers() {
+        ALL_OPTIONS.clear();
+    }
+
     @Override
     public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
         org.apache.camel.example.MyBean target = (org.apache.camel.example.MyBean) obj;
diff --git a/examples/camel-example-main-tiny/src/generated/resources/META-INF/services/org/apache/camel/configurer/MyBean b/examples/camel-example-main-tiny/src/generated/resources/META-INF/services/org/apache/camel/configurer/MyBean
deleted file mode 100644
index 24d3637..0000000
--- a/examples/camel-example-main-tiny/src/generated/resources/META-INF/services/org/apache/camel/configurer/MyBean
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.example.MyBeanConfigurer
diff --git a/examples/camel-example-main-tiny/src/main/resources/application.properties b/examples/camel-example-main-tiny/src/main/resources/application.properties
index e46716f..e88274c 100644
--- a/examples/camel-example-main-tiny/src/main/resources/application.properties
+++ b/examples/camel-example-main-tiny/src/main/resources/application.properties
@@ -17,8 +17,7 @@
 
 # to configure camel main
 # here you can configure options on camel main (see MainConfigurationProperties class)
-camel.main.name = MyCoolCamel
-camel.main.jmx-enabled = false
+camel.main.name = MyTinyCamel
 
 # enable tracing
 ### camel.main.tracing = true
@@ -27,28 +26,15 @@ camel.main.jmx-enabled = false
 camel.main.beanIntrospectionExtendedStatistics=true
 camel.main.beanIntrospectionLoggingLevel=INFO
 
-# you can also configure camel context directly
-# camel.context.shutdown-strategy.shutdown-now-on-timeout = false
+# run in lightweight mode to be tiny as possible
+camel.main.lightweight = true
 
-# load additional property placeholders from this folder
-camel.main.file-configurations=src/main/data/*.properties
-
-# to configure Hystrix EIP (global and you need to add camel-hystrix to the classpath)
-### camel.hystrix.group-key=myGroup
-### camel.hystrix.execution-timeout-in-milliseconds=5000
-
-# to configure Rest DSL (global and you need to add camel-undertow to the classpath)
-### camel.rest.component=undertow
-### camel.rest.port=8080
-### camel.rest.component-properties[host-options.buffer-size]=8192
-
-# you can configure whether OS environment should override (=2 which is default) or as fallback (=1)
-### camel.component.properties.environment-variable-mode=1
-
-# properties used in the route
-myPeriod = 1000
+# can be used to not start the route
+# camel.main.auto-startup = false
 
 # configure beans
 camel.beans.myBean = #class:org.apache.camel.example.MyBean
 camel.beans.myBean.hi = Hello
 
+# properties used in the route
+myPeriod = 1000