RabbitMQ connector enabling TLS connection
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 file I see that the Camel component is configured with connectionFactory bean from the Spring.
- At first glance, the
CachingConnectionFactoryinterface doesn't have any method for enabling TLS - One option is to set
com.rabbitmq.client.ConnectionFactoryinstance configured with TLS in theCachingConnectionFactoryconstructor. - 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://localhostoramqps://localhostfor TLS connections.
So unless there is an easier way (that I missed) to enable TLS, my proposal is to change the Kamelet to
...
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 will be in Kamelets catalog 4.12.0
when 4.12.0 is planned to release?
For the kamelets catalog it should be this week. For camel Kafka connector I don't know. We are trying to release only LTS stream and the next one will be 4.13
Many, thanks your support