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-spring-boot.git


The following commit(s) were added to refs/heads/master by this push:
     new a7f4849  CAMEL-16353: camel-main - Add @EagerClassloaded to mark 
classes which should be eager loaded via camel-main. This optimize to load 
these classes before Camel is started and otherwise would load these classes on 
first message processed. A maven plugin scans the code and updates the source 
code to keep the list of classes to eager loaded automatic up-to-date.
a7f4849 is described below

commit a7f4849f4587d7663fb4518f8f36fcbfa927339e
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Mar 31 14:26:45 2021 +0200

    CAMEL-16353: camel-main - Add @EagerClassloaded to mark classes which 
should be eager loaded via camel-main. This optimize to load these classes 
before Camel is started and otherwise would load these classes on first message 
processed. A maven plugin scans the code and updates the source code to keep 
the list of classes to eager loaded automatic up-to-date.
---
 core/camel-spring-boot/src/main/docs/spring-boot.adoc              | 3 ++-
 .../org/apache/camel/spring/boot/CamelConfigurationProperties.java | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/core/camel-spring-boot/src/main/docs/spring-boot.adoc 
b/core/camel-spring-boot/src/main/docs/spring-boot.adoc
index da68030..586a815 100644
--- a/core/camel-spring-boot/src/main/docs/spring-boot.adoc
+++ b/core/camel-spring-boot/src/main/docs/spring-boot.adoc
@@ -92,7 +92,7 @@ When using spring-boot with Spring Boot make sure to use the 
following Maven dep
 ----
 
 
-The component supports 169 options, which are listed below.
+The component supports 170 options, which are listed below.
 
 
 
@@ -159,6 +159,7 @@ The component supports 169 options, which are listed below.
 | *camel.springboot.duration-max-idle-seconds* | To specify for how long time 
in seconds Camel can be idle before automatic terminating the JVM. You can use 
this to run Spring Boot for a short while. | 0 | Integer
 | *camel.springboot.duration-max-messages* | To specify how many messages to 
process by Camel before automatic terminating the JVM. You can use this to run 
Spring Boot for a short while. | 0 | Integer
 | *camel.springboot.duration-max-seconds* | To specify for how long time in 
seconds to keep running the JVM before automatic terminating the JVM. You can 
use this to run Spring Boot for a short while. | 0 | Integer
+| *camel.springboot.eager-classloading* | Whether to eager load a common set 
of Camel classes that would otherwise first be loaded on processing the first 
message. By eager loading these classes then the JVM has already loaded the 
classes during build phase, which allows Camel to process the first message 
faster. | false | Boolean
 | *camel.springboot.endpoint-bridge-error-handler* | Allows for bridging the 
consumer to the Camel routing Error Handler, which mean any exceptions occurred 
while the consumer is trying to pickup incoming messages, or the likes, will 
now be processed as a message and handled by the routing Error Handler. <p/> By 
default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal 
with exceptions, that will be logged at WARN/ERROR level and ignored. The 
default value is false.  [...]
 | *camel.springboot.endpoint-lazy-start-producer* | 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 otherwise fail during starting and cause the route to fail being started. 
By deferring this startup to be lazy then the startup failure can be handled 
during routing messages via Camel's routing error handlers. Beware that when 
the first message is processed  [...]
 | *camel.springboot.endpoint-runtime-statistics-enabled* | Sets whether 
endpoint runtime statistics is enabled (gathers runtime usage of each incoming 
and outgoing endpoints). The default value is false. | false | Boolean
diff --git 
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
 
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
index 5dfdfbc..17299b1 100644
--- 
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
+++ 
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
@@ -657,6 +657,13 @@ public class CamelConfigurationProperties extends 
DefaultConfigurationProperties
     private boolean lightweight;
 
     /**
+     * Whether to eager load a common set of Camel classes that would 
otherwise first be loaded on processing the first
+     * message. By eager loading these classes then the JVM has already loaded 
the classes during build phase, which
+     * allows Camel to process the first message faster.
+     */
+    private boolean eagerClassloading;
+
+    /**
      * Controls whether to pool (reuse) exchanges or create new exchanges 
(prototype). Using pooled will reduce JVM
      * garbage collection overhead by avoiding to re-create Exchange instances 
per message each consumer receives. The
      * default is prototype mode.

Reply via email to