> For the complete documentation index, see [llms.txt](https://docs.rumi.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rumi.systems/rumi-cli/commands/quickstart/connector.md).

# connector

Generate a Connector service (a Rumi message-bus binding to an external system).

## Syntax

```bash
rumi quickstart connector [options]
```

## Options

| Option       | Short | Description                | Default           |
| ------------ | ----- | -------------------------- | ----------------- |
| `--app-root` | `-r`  | Application root directory | `rumi-quickstart` |

## Example

```bash
rumi quickstart connector --app-root my-app
```

## What Gets Generated

The command scaffolds a complete, deployable microservice whose message bus is backed by a connector you write. The generated microservice includes its own Maven module, message model, configuration fragments, and launch scripts, plus a connector class implementing the four-method `Connector` contract:

| Method            | When it runs                     | What you put there                                                                                 |
| ----------------- | -------------------------------- | -------------------------------------------------------------------------------------------------- |
| `open`            | Once, when the bus binding opens | Read configuration, connect to the external system                                                 |
| `run`             | On a dedicated inbound thread    | For a source connector, read from the external system and emit into Rumi via `processInbound(...)` |
| `processOutbound` | On each outbound message         | For a sink connector, write the message out to the external system                                 |
| `close`           | Once, when the binding closes    | Release connections and flush anything buffered                                                    |

The generated connector body is a documented skeleton rather than a working integration. This is deliberate, and matches the [processor](/rumi-cli/commands/quickstart/processor.md) and [driver](/rumi-cli/commands/quickstart/driver.md) quickstart microservices, which are likewise scaffolding you fill in as you work through the tutorial.

{% hint style="info" %}
A connector is a message-bus binding, not a bolt-on. The microservice generated here is a first-class Rumi microservice that happens to reach an external system through the connector you supply.
{% endhint %}

## Filling In the Connector

A natural first connector is one that writes each message it receives to a CSV file. Working outward from the skeleton:

1. In `open`, read the output path from configuration and open a writer for it.
2. In `processOutbound`, project the fields you care about off the outbound `MessageView` and append them as a row.
3. In `close`, flush and close the writer so no rows are lost on shutdown.

Because the connector is bound to the microservice through a `connector://` bus binding in `config.xml`, nothing else in the application needs to change when you swap a CSV implementation for one that talks to a database, an object store, or a downstream API.

## See Also

* [app](/rumi-cli/commands/quickstart/app.md) - Generate a complete application
* [processor](/rumi-cli/commands/quickstart/processor.md) - Generate a Processor microservice
* [webservice](/rumi-cli/commands/quickstart/webservice.md) - Generate a Webservice microservice
* [driver](/rumi-cli/commands/quickstart/driver.md) - Generate a Driver microservice
