We have microservices which are communicating each other via RabbitMQ.
For example :- we have services ServiceA, ServiceB, ServiceC.
ServiceA sends ADto message to ServiceB via RabbitMq with routing key service.a.100
ServiceB sends BDto message to ServiceC via RabbitMq with routing key service.b.200
ADto message:
{
"@dto": "A",
"quantity": 100,
"price": 10
}
BDto message:
{
"@dto": "B",
"quantity": 200,
"price": 20
}
We need to publish ADto and BDto messages to another ServiceD service which uses Kafka.
To publish RabbitMq ADto and BDto messages to Kafka, we are planning to use Kafka connectors e.g Confluent provides RabbitMQSourceConnector.
RabbitMQSourceConnector - pulls messages from RabbitMQ queue and writes messages into Kafka topics.
We need to get routing keys in Kafka because we have identifier (e.g service.a.100 where we need 'a' and '100') in routing keys for identify messages, we do not have identifier in the messages but Kafka does not support routing key instead it uses topic partitions.
Is there way to map routing key in connector configurations while registering confluent RabbitMQSourceConnector in Kafka connector in the Kafka cluster?