We have microservices which are communicating each other via RabbitMQ.
For example :- we have services ServiceA, ServiceB, ServiceC, ServiceD.
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 service ServiceD
which uses Kafka as broker.
To publish ADto and BDto messages from RabbitMQ to Kafka , we are planning to use Confluent Kafka connector i.e RabbitMQSourceConnector .
RabbitMQSourceConnector - pulls messages from RabbitMQ queue and writes messages into Kafka topics .
We need routing keys in Kafka connector because we have identifier in routing key (e.g service.a.100 where we need ‘a’ and ‘100’) for further processing since we do not have identifier in the messages but Kafka does not support routing key.
Is there way to read routing key in Kafka connector when RabbitMQSourceConnector writes messages into Kafka topic ?