# Is there way to read routing key in Kafka connector when RabbitMQSourceConnector writes messages into Kafka topic?

**URL:** <https://forum.confluent.io/t/is-there-way-to-read-routing-key-in-kafka-connector-when-rabbitmqsourceconnector-writes-messages-into-kafka-topic/2490>\
**Category:** Kafka Connect\
**Created:** [13 August 2021 08:11 UTC](https://forum.confluent.io/t/is-there-way-to-read-routing-key-in-kafka-connector-when-rabbitmqsourceconnector-writes-messages-into-kafka-topic/2490 "2021-08-13T08:11:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivusajjan086](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@shivusajjan086](https://forum.confluent.io/u/shivusajjan086)\
**Post date:** [13 August 2021 08:11 UTC](https://forum.confluent.io/t/is-there-way-to-read-routing-key-in-kafka-connector-when-rabbitmqsourceconnector-writes-messages-into-kafka-topic/2490/1 "2021-08-13T08:11:38Z")

</div>

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:

```auto
{
"@dto": "A",
"quantity": 100,
"price": 10
}

```

BDto message:

```auto
{
"@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 ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [12 September 2021 08:12 UTC](https://forum.confluent.io/t/is-there-way-to-read-routing-key-in-kafka-connector-when-rabbitmqsourceconnector-writes-messages-into-kafka-topic/2490/2 "2021-09-12T08:12:26Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
