davsclaus opened a new issue #474: Support dependency injecition of 
ProducerTemplate/ConsumerTemplate 
URL: https://github.com/apache/camel-quarkus/issues/474
 
 
   If you have a quarks rest service then you may want to inject Camel as a 
producer or consumer template (also the fluent builder kind)
   
   ```
   @Path("/hello")
   public class ExampleResource {
   
       @Inject
       private CamelContext camel;
   
       @GET
       @Produces(MediaType.TEXT_PLAIN)
       public String hello() {
           return "hello";
       }
   
       @GET
       @Path("/bye")
       @Produces(MediaType.TEXT_PLAIN)
       public String bye() throws Exception {
           return 
camel.createFluentProducerTemplate().to("direct:bye").request(String.class);
       }
   }
   ```
   
   But so far its only inject of `CamelContext` that works.
   
   It would be nice to inject
   
       @Inject
       private ProducerTemplate camel;
   
   And if you add the camel annotations for `@Produce` and `@Consume` and also 
the older `@EndpointInject` name which works on both producer and consumer 
templates
   
       @Inject
       @Produce("kafka:blah")
       private FluentProducerTemplate camel;
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to