astefanutti opened a new issue #1961:
URL: https://github.com/apache/camel-k/issues/1961


   From the following example:
   
   ```java
   // camel-k: language=java property-file=application.properties
   // camel-k: dependency=github:keunlee:camel-k-starter-workbench
   
   import org.apache.camel.BindToRegistry;
   import org.apache.camel.PropertyInject;
   import org.apache.camel.builder.RouteBuilder;
   import org.slf4j.Logger;
   import org.slf4j.LoggerFactory;
   import org.apache.qpid.jms.JmsConnectionFactory;
   
   public class HelloToAmqp extends RouteBuilder {
       private static final Logger LOG = 
LoggerFactory.getLogger(HelloToAmqp.class);
   
       @PropertyInject("messaging.broker.url.amqp")
       String messagingBrokerUrl;
   
       @BindToRegistry
       public JmsConnectionFactory connectionFactory() throws Exception {
           return new JmsConnectionFactory(messagingBrokerUrl);
       }
   
       @Override
       public void configure() throws Exception {
           from("timer:refresh?period=5000&fixedRate=true")
           .setBody()
           .simple("Hello World ${header.firedTime}")
           .log("${body}")
           
.to("amqp:topic:example?exchangePattern=InOnly&connectionFactory=connectionFactory");
       }
   }
   ```
   
   It could be improved if:
   * Lookup by type of the connection factory would work
   * Remove the property injection and the connection factory method 
altogether, and simply pass `quarkus.qpid-jms.url` in the 
`application.properties` file.


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


Reply via email to