You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "ogomezdi (via GitHub)" <gi...@apache.org> on 2025/02/21 14:21:13 UTC

Re: [I] CDI with Camel K runtime 1.7. [camel-k-runtime]

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

   I've seen in Camel K 2.6 there is a new feature for plain-quarkus
   `  traits:
       camel:
         runtimeProvider: plain-quarkus
   `
   But I was trying to use @Inject with resource created but not working. Are we still waiting for CDI to work? or Is there any option to add?
   I'm trying with:
   `// camel-k: name=hello-world
   // camel-k: dependency=camel-quarkus-fhir
   // camel-k: trait=camel.runtime-provider=plain-quarkus 
   
   import org.apache.camel.builder.RouteBuilder;
   
   import ca.uhn.fhir.context.FhirContext;
   
   import jakarta.enterprise.context.ApplicationScoped;
   import jakarta.inject.Inject;
   
   @ApplicationScoped
   public class HelloWorld extends RouteBuilder {
       
   	@Inject
   	FhirContext fhircontext;
   	
   	@Override
       public void configure() throws Exception {
   		
   		System.out.println("¡¡¡¡¡¡Bean: " + fhircontext + " !!!!");
   		
           from("timer:hello?period=1000")
   			.routeId("Hello")
               .log("Hello World!");
       }
   }`
   But still getting null
   


-- 
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-unsubscribe@camel.apache.org

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