ogomezdi commented on issue #770:
URL: 
https://github.com/apache/camel-k-runtime/issues/770#issuecomment-2677831881

   > In theory everything working with plain Camel Quarkus should be working 
the same in Camel K with this new approach. Can you try doing exactly the same 
with a local execution (ie, via Camel JBang run with Quarkus runtime)?
   
   I've tried with Quarkus runtime, and there is working properly, let me show 
you output logs:
   
   - For Camel k Execution
   `[1] 2025-02-24 09:06:15,413 INFO  [ca.uhn.fhi.uti.VersionUtil] (main) HAPI 
FHIR version 7.4.0 - Rev 71e9af61cf
   [1] 2025-02-24 09:06:15,415 INFO  [ca.uhn.fhi.con.FhirContext] (main) 
Creating new FHIR context for FHIR version [R4]
   [1] 2025-02-24 09:06:21,399 INFO  
[org.apa.cam.qua.cor.CamelBootstrapRecorder] (main) Apache Camel Quarkus 3.15.1 
is starting
   [1] 2025-02-24 09:06:21,400 INFO  [org.apa.cam.mai.MainSupport] (main) 
Apache Camel (Main) 4.8.1 is starting
   [1] 2025-02-24 09:06:24,604 INFO  [org.apa.cam.mai.BaseMainSupport] (main) 
Auto-configuration summary
   [1] 2025-02-24 09:06:24,605 INFO  [org.apa.cam.mai.BaseMainSupport] (main)   
  [MicroProfilePropertiesSource] camel.main.routesIncludePattern = 
file:/etc/camel/sources/**
   [1] 2025-02-24 09:06:24,605 INFO  [org.apa.cam.mai.BaseMainSupport] (main)   
  [MicroProfilePropertiesSource] camel.main.sourceLocationEnabled = true
   [1] ¡¡¡¡¡¡Bean: -null-!!!!
   [1] 2025-02-24 09:06:25,011 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] 
(main) Apache Camel 4.8.1 (camel-1) is starting
   [1] 2025-02-24 09:06:25,019 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] 
(main) Routes startup (total:1)
   [1] 2025-02-24 09:06:25,019 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] 
(main)     Started Hello (timer://hello)
   [1] 2025-02-24 09:06:25,094 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] 
(main) Apache Camel 4.8.1 (camel-1) started in 7ms (build:0ms init:0ms 
start:7ms)
   [1] 2025-02-24 09:06:25,100 INFO  [io.quarkus] (main) camel-k-integration 
2.6.0 on JVM (powered by Quarkus 3.15.2) started in 11.091s.
   [1] 2025-02-24 09:06:25,100 INFO  [io.quarkus] (main) Profile prod activated.
   [1] 2025-02-24 09:06:25,100 INFO  [io.quarkus] (main) Installed features: 
[camel-core, camel-fhir, camel-java-joor-dsl, camel-timer, cdi]
   [1] 2025-02-24 09:06:26,023 INFO  [Hel.java:28] (Camel (camel-1) thread #1 - 
timer://hello) Hello World!
   [1] 2025-02-24 09:06:27,018 INFO  [Hel.java:28] (Camel (camel-1) thread #1 - 
timer://hello) Hello World!`
   Log line at 2025-02-24 09:06:24,605 showing ¡¡¡¡¡¡Bean: -**null**-!!!!
   
   - From Quarkus runtime:
   `2025-02-24 10:10:35,362 INFO  [ca.uhn.fhi.uti.VersionUtil] (main) HAPI FHIR 
version 7.4.0 - Rev 71e9af61cf
   2025-02-24 10:10:35,367 INFO  [ca.uhn.fhi.con.FhirContext] (main) Creating 
new FHIR context for FHIR version [R4]
   2025-02-24 10:10:37,205 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] 
(main) Apache Camel Quarkus 3.15.1 is starting
   2025-02-24 10:10:37,207 INFO  [org.apa.cam.mai.MainSupport] (main) Apache 
Camel (Main) 4.8.1 is starting
   ¡¡¡¡¡¡Bean: -FhirContext[R4]-!!!!
   2025-02-24 10:10:37,399 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] 
(main) Apache Camel 4.8.1 (camel-1) is starting
   2025-02-24 10:10:37,410 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] 
(main) Routes startup (total:1)
   2025-02-24 10:10:37,410 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] 
(main)     Started Hello (timer://hello)
   2025-02-24 10:10:37,410 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] 
(main) Apache Camel 4.8.1 (camel-1) started in 10ms (build:0ms init:0ms 
start:10ms)
   2025-02-24 10:10:37,417 INFO  [io.quarkus] (main) hello-world 1.0.0 on JVM 
(powered by Quarkus 3.15.2) started in 2.359s.
   2025-02-24 10:10:37,417 INFO  [io.quarkus] (main) Profile prod activated.
   2025-02-24 10:10:37,418 INFO  [io.quarkus] (main) Installed features: 
[camel-core, camel-fhir, camel-timer, cdi]
   2025-02-24 10:10:38,444 INFO  [Hello] (Camel (camel-1) thread #1 - 
timer://hello) Hello World!
   2025-02-24 10:10:39,409 INFO  [Hello] (Camel (camel-1) thread #1 - 
timer://hello) Hello World!
   2025-02-24 10:10:40,411 INFO  [Hello] (Camel (camel-1) thread #1 - 
timer://hello) Hello World!`
   Log line at 2025-02-24 10:10:37,207 showing ¡¡¡¡¡¡Bean: 
-**FhirContext[R4]**-!!!!
   
   The route it's soo simple, in both cases I've used:
   `
   // camel-k: name=hello-world
   // camel-k: dependency=camel-quarkus-fhir
   // camel-k: trait=camel.runtime-provider=plain-quarkus 
   
   package org.acme.osgomez;
   
   import org.apache.camel.builder.RouteBuilder;
   
   import ca.uhn.fhir.context.FhirContext;
   import jakarta.enterprise.context.ApplicationScoped;
   import jakarta.inject.Inject;
   import jakarta.inject.Named;
   
   @ApplicationScoped
   public class HelloWorld extends RouteBuilder {
       
        @Inject
        @Named("R4")
        FhirContext fhircontext;
   
        @Override
       public void configure() throws Exception {
                
        System.out.println("¡¡¡¡¡¡Bean: -" + fhircontext + "-!!!!");
                
           from("timer:hello?period=1000")
                        .routeId("Hello")
               .log("Hello World!");
       }
   }
   `
   Finally de pom used for Quarkus runtime was:
   `<?xml version="1.0" encoding="UTF-8"?>
   <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
       <modelVersion>4.0.0</modelVersion>
       <groupId>org.acme.osgomez</groupId>
       <artifactId>hello-world</artifactId>
       <version>1.0.0</version>
   
       <properties>
           <compiler-plugin.version>3.13.0</compiler-plugin.version>
           <maven.compiler.release>21</maven.compiler.release>
           <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
           
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
           
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
           
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
           <quarkus.platform.version>3.15.2</quarkus.platform.version>
           <skipITs>true</skipITs>
           <surefire-plugin.version>3.3.1</surefire-plugin.version>
       </properties>
   
       <dependencyManagement>
           <dependencies>
               <dependency>
                   <groupId>${quarkus.platform.group-id}</groupId>
                   <artifactId>${quarkus.platform.artifact-id}</artifactId>
                   <version>${quarkus.platform.version}</version>
                   <type>pom</type>
                   <scope>import</scope>
               </dependency>
               <dependency>
                   <groupId>${quarkus.platform.group-id}</groupId>
                   <artifactId>quarkus-camel-bom</artifactId>
                   <version>${quarkus.platform.version}</version>
                   <type>pom</type>
                   <scope>import</scope>
               </dependency>
           </dependencies>
       </dependencyManagement>
   
       <dependencies>
           <dependency>
               <groupId>org.apache.camel.quarkus</groupId>
               <artifactId>camel-quarkus-fhir</artifactId>
           </dependency>
           <dependency>
               <groupId>org.apache.camel.quarkus</groupId>
               <artifactId>camel-quarkus-core</artifactId>
           </dependency>
           <dependency>
               <groupId>org.apache.camel.quarkus</groupId>
               <artifactId>camel-quarkus-timer</artifactId>
           </dependency>
           <dependency>
               <groupId>io.quarkus</groupId>
               <artifactId>quarkus-arc</artifactId>
           </dependency>
           <dependency>
               <groupId>io.quarkus</groupId>
               <artifactId>quarkus-junit5</artifactId>
               <scope>test</scope>
           </dependency>
       </dependencies>
   
       <build>
           <plugins>
               <plugin>
                   <groupId>${quarkus.platform.group-id}</groupId>
                   <artifactId>quarkus-maven-plugin</artifactId>
                   <version>${quarkus.platform.version}</version>
                   <extensions>true</extensions>
                   <executions>
                       <execution>
                           <goals>
                               <goal>build</goal>
                               <goal>generate-code</goal>
                               <goal>generate-code-tests</goal>
                               <goal>native-image-agent</goal>
                           </goals>
                       </execution>
                   </executions>
               </plugin>
               <plugin>
                   <artifactId>maven-compiler-plugin</artifactId>
                   <version>${compiler-plugin.version}</version>
                   <configuration>
                       <parameters>true</parameters>
                   </configuration>
               </plugin>
               <plugin>
                   <artifactId>maven-surefire-plugin</artifactId>
                   <version>${surefire-plugin.version}</version>
                   <configuration>
                       <systemPropertyVariables>
                           
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                           <maven.home>${maven.home}</maven.home>
                       </systemPropertyVariables>
                   </configuration>
               </plugin>
               <plugin>
                   <artifactId>maven-failsafe-plugin</artifactId>
                   <version>${surefire-plugin.version}</version>
                   <executions>
                       <execution>
                           <goals>
                               <goal>integration-test</goal>
                               <goal>verify</goal>
                           </goals>
                       </execution>
                   </executions>
                   <configuration>
                       <systemPropertyVariables>
                           
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
                           
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                           <maven.home>${maven.home}</maven.home>
                       </systemPropertyVariables>
                   </configuration>
               </plugin>
           </plugins>
       </build>
   
       <profiles>
           <profile>
               <id>native</id>
               <activation>
                   <property>
                       <name>native</name>
                   </property>
               </activation>
               <properties>
                   <skipITs>false</skipITs>
                   <quarkus.native.enabled>true</quarkus.native.enabled>
               </properties>
           </profile>
       </profiles>
   </project>
   `
   Maybe the difference relies on how the Route it's been loaded, camel k loads 
the route at runtime, but I'm not sure.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to