davsclaus commented on issue #500:
URL: https://github.com/apache/camel-karavan/issues/500#issuecomment-1290000057

   Depending on the runtime you export as you should use their way of 
annotations
   
   For example for quarkus
   https://camel.apache.org/manual/camel-jbang.html#_using_quarkus_injection
   
   The camel-quarkus does not understand classes annotated with the Camel 
BindToRegistry annotation - You need to use their @Named @Singleton combo.
   
   If you make the processor as follows (then it can run in both jbang and 
quarkus)
   ```
   import org.apache.camel.Exchange;
   import org.apache.camel.Processor;
   
   import javax.inject.Named;
   import javax.inject.Singleton;
   
   @Singleton @Named("CustomProcessor")
   public class CustomProcessor implements Processor {
   
     public void process(Exchange exchange) throws Exception {
         exchange.getIn().setBody("Hello world");
     }
   }
   ```


-- 
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