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 44fdcc6  CAMEL-16353: camel-core - Force eager classloading in build 
phase
44fdcc6 is described below

commit 44fdcc68ea7c64e33293230ffa5d3c99b58fa07c
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Sun Mar 14 13:01:14 2021 +0100

    CAMEL-16353: camel-core - Force eager classloading in build phase
---
 .../main/java/org/apache/camel/impl/engine/PooledExchangeFactory.java  | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/PooledExchangeFactory.java
 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/PooledExchangeFactory.java
index ebd8ee0..f45d105 100644
--- 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/PooledExchangeFactory.java
+++ 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/PooledExchangeFactory.java
@@ -47,6 +47,9 @@ public final class PooledExchangeFactory extends 
PrototypeExchangeFactory {
         // force to create and load the class during build time so the JVM 
does not
         // load the class on first exchange to be created
         DefaultPooledExchange dummy = new DefaultPooledExchange(camelContext);
+        // force message init to load classes
+        dummy.getIn();
+        dummy.getIn().getHeaders();
         LOG.trace("Warming up PooledExchangeFactory loaded class: {}", 
dummy.getClass().getName());
     }
 

Reply via email to