jakubmalek opened a new issue, #1718:
URL: https://github.com/apache/camel-kafka-connector/issues/1718

   I'm struggle to find an option to enable TLS connection for RabbitMQ client 
in the connector.
   
   Looking at the 
[spring-rabbitmq-source.kamelet.yaml](https://github.com/apache/camel-kamelets/blob/v4.11.0/kamelets/spring-rabbitmq-source.kamelet.yaml)
 file I see that the Camel component is configured with `connectionFactory` 
bean from the Spring.
   - At first glance, the `CachingConnectionFactory` interface doesn't have any 
method for enabling TLS
   - One option is to set `com.rabbitmq.client.ConnectionFactory` instance 
configured with TLS in the `CachingConnectionFactory` constructor.
   - The other, which is more easy for Kamelet, is to set the URI parameter 
instead of a host name where its possible to define the protocol e.g. 
`amqp://localhost` or `amqps://localhost` for TLS connections.
   
   So unless there is an easier way (that I missed) to enable TLS, my proposal 
is to change the Kamelet to
   
   ```yaml
   ...
   properties:
     ...
     protocol:
       title:  Protocol
       description: The AMQP protocol to use.
       type: string
       enum: ["amqp", "amqps"]
       default: "amqp"
     dependencies:
       - "camel:spring-rabbitmq"
       - "camel:kamelet"
     template:
       beans:
         - name: connectionFactory
           type: 
"#class:org.springframework.amqp.rabbit.connection.CachingConnectionFactory"
           properties:
             username: '{{?username}}'
             password: '{{?password}}'
             uri: '{{protocol}}://{{host}}:{{port}}'
             virtualHost: "{{vhost}}"
   ...
   ```
   
   With `protocol` configured, we can enable or disable TLS.


-- 
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.apache.org

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

Reply via email to