---
title: t Kafka
description: Available triggers
documentId: ipaas-kafka-trigger
locale: en-US
---

The [**Kafka**](https://camel.apache.org/components/4.10.x/kafka-component.html) component is used for communication with the Apache Kafka message broker.

**URI Syntax**: `kafka:topic`

## Main Fields

*Path parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|----------------|-------------|----------|
| `topic` (common) | (required) Name of the topic to be used. On the consumer (trigger), you can use a comma to separate multiple topics. A producer (connector) can only send messages to a single topic. | —  | String |

*Query parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|----------------|-------------|----------|
| `brokers` (common) | URL of the Kafka brokers to be used. The format is `host1:port1,host2:port2`, and the list can be a subset of brokers or a VIP pointing to a subset of brokers. This option is known as `bootstrap.servers` in the Kafka documentation. | —  | String |
| `topicIsPattern` (consumer) | Defines if the topic is a pattern (regular expression). This can be used to subscribe to a dynamic number of topics matching the pattern. | false | boolean |

## Example

The flow below receives messages, interprets the content, routes to different topics according to the status, and logs the result.

<Steps>
<Step>
The flow starts listening to messages from the Kafka topic called `topic-1`, using the provided brokers, a `clientId`, and a `groupId`.
</Step>
<Step>
When a message arrives, it is converted from JSON to object using the Jackson library.
</Step>
<Step>
The flow checks the status field of the message.
If status is `URGENT`, it sends the message to the topic `topic-urgent`.
Otherwise, it sends it to the topic `topic-common`.
</Step>
<Step>
Finally, it logs the content of the processed message.
</Step>
</Steps>

```yaml
- from:
    uri: kafka:topic-1
    parameters:
      brokers: 54.207.234.81:9093, 54.207.234.81:9094
      clientId: 1b37dae6-3eac-4e61-8fd9-c525b67c87fb
      groupId: processing-group-1
    steps:
      - unmarshal:
          json:
            library: Jackson
      - choice:
          when:
            - simple: "${body[status]} == 'URGENT'"
              steps:
                - to: "kafka:topic-urgent?brokers=54.207.234.81:9093"
          otherwise:
            steps:
              - to: "kafka:topic-common?brokers=54.207.234.81:9093"
      - log:
          message: "Log: ${body}"
```

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/kafka_trigger_8d03003784.png)
