> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devset.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Kafka and RabbitMQ Broker Connectors in Devset

> Set up named Kafka and RabbitMQ connections in Devset so your workflows can produce and consume events without hardcoding broker details.

Broker connectors are named, reusable connection profiles that Devset stores locally and makes available to your workflows. Instead of embedding broker addresses and credentials directly in a workflow definition, you create a connector once and then reference it by name. This keeps your workflows portable and makes it easy to point the same workflow at a different broker — development, staging, or production — by swapping a single value.

## Add a Connector via the Settings UI

<Steps>
  <Step title="Open Settings">
    Navigate to **Settings** in the Devset UI ([http://localhost:8082](http://localhost:8082)).
  </Step>

  <Step title="Select the Brokers tab">
    Click the **Brokers** tab at the top of the Settings page. Any connectors you have already created are listed here.
  </Step>

  <Step title="Fill in the connector form">
    Click **Add Connector**, choose your broker type (Kafka or RabbitMQ), then complete the fields for that type. See the field reference below.
  </Step>

  <Step title="Save">
    Click **Save**. The connector appears in the list and is immediately available for use in workflow definitions.
  </Step>
</Steps>

## Connector Field Reference

<Tabs>
  <Tab title="Kafka">
    Use the `kafka` type when connecting to an Apache Kafka cluster.

    <ParamField body="name" type="string" required>
      A unique identifier for this connector. Workflow definitions reference this connector by setting `producerName` to this value. Use a descriptive slug such as `local-kafka` or `prod-kafka`.
    </ParamField>

    <ParamField body="bootstrapServers" type="string" required>
      A comma-separated list of Kafka broker addresses in `host:port` format. For a local broker this is typically `localhost:9092`. For a multi-broker cluster, list all seed brokers, for example `broker1:9092,broker2:9092`.
    </ParamField>
  </Tab>

  <Tab title="RabbitMQ">
    Use the `rabbit` type when connecting to a RabbitMQ broker.

    <ParamField body="name" type="string" required>
      A unique identifier for this connector. Workflow definitions reference this connector by setting `producerName` to this value.
    </ParamField>

    <ParamField body="host" type="string" required>
      The hostname or IP address of the RabbitMQ broker, for example `localhost` or `rabbitmq.internal`.
    </ParamField>

    <ParamField body="port" type="integer" required>
      The AMQP port. The default RabbitMQ port is `5672`. Use `5671` if TLS is enabled.
    </ParamField>

    <ParamField body="virtualHost" type="string" required>
      The RabbitMQ virtual host to connect to. The default virtual host is `/`.
    </ParamField>

    <ParamField body="username" type="string" required>
      The username Devset uses to authenticate with the broker. The RabbitMQ default is `guest`.
    </ParamField>

    <ParamField body="password" type="string" required>
      The password for the specified username. The RabbitMQ default is `guest`.
    </ParamField>
  </Tab>
</Tabs>

## Reference a Connector in a Workflow

Once you have saved a connector, reference it in any workflow step by setting `producerName` to the connector's `name` value. For example, if you created a Kafka connector named `local-kafka`, your workflow step looks like this:

```json theme={null}
{
  "producerName": "local-kafka",
  "topic": "orders.created",
  "payload": { ... }
}
```

Multiple connectors of the same type can exist simultaneously, which lets you direct different workflow steps to different brokers within the same project.

## Delete a Connector via the UI

Open **Settings → Brokers**, locate the connector you want to remove, and click the **Delete** icon next to it. Deleting a connector does not modify any workflow definitions that reference it by name, so make sure no active workflows depend on the connector before removing it.

<Warning>
  Workflows that reference a deleted connector by `producerName` will fail at runtime. Update or remove those references before deleting the connector.
</Warning>

## API Reference

You can manage broker connectors programmatically using the Devset REST API.

### Create a Connector

<CodeGroup>
  ```bash Kafka theme={null}
  curl -X POST http://localhost:8082/connectors/configurations \
    -H "Content-Type: application/json" \
    -d '{
      "type": "kafka",
      "name": "local-kafka",
      "bootstrapServers": "localhost:9092"
    }'
  ```

  ```bash RabbitMQ theme={null}
  curl -X POST http://localhost:8082/connectors/configurations \
    -H "Content-Type: application/json" \
    -d '{
      "type": "rabbit",
      "name": "local-rabbit",
      "host": "localhost",
      "port": 5672,
      "virtualHost": "/",
      "username": "guest",
      "password": "guest"
    }'
  ```
</CodeGroup>

### List All Connectors

```bash theme={null}
curl http://localhost:8082/connectors/configurations
```

### Delete a Connector

Replace `{type}` with `kafka` or `rabbit`, and `{name}` with the connector's name.

```bash theme={null}
curl -X DELETE http://localhost:8082/connectors/configurations/kafka/local-kafka
```

<Tip>
  All connector data is persisted in Devset's local SQLite database. Back up the database file (or its Docker volume) to preserve your connector configurations across environments.
</Tip>
