# Configuration (/connectors/cloudevents/reference/configuration)



This is the full field reference for the CloudEvents connector's `Connectors.CE`
config section — every field, its validation rules, and how to set them via TOML,
environment variables, or Docker. For the enabled-by-default model and how config
keys map to environment variable names, see the
[configuration model](../concepts/configuration-model).

## Config fields [#config-fields]

All fields live under `[Connectors.CE]`. Defaults are taken verbatim from the
server's `CeConfig` struct.

<TypeTable
  type="{
  Enable: {
    description: 'Whether the CloudEvents connector is mounted on the shared HTTP server.',
    type: 'bool',
    default: 'true',
  },
  TimeoutSeconds: {
    description: 'Timeout for synchronous POST endpoints (/ce/send/*, /ce/queue/*). Also the default timeout for command and query requests. Exceeding it returns HTTP 504. SSE GET endpoints are long-lived and not subject to this timeout.',
    type: 'int',
    default: '60',
  },
  SubBuffSize: {
    description: 'Buffer size for each SSE subscription channel. Must be greater than 0 and at most 10000.',
    type: 'int',
    default: '100',
  },
  MaxSSEIdleSeconds: {
    description: 'Maximum idle time before an SSE connection is closed. The idle timer resets on every received message; on expiry the server emits an error event with &#x22;stream idle timeout&#x22; and closes the stream.',
    type: 'int',
    default: '300',
  },
  MaxSSEConnections: {
    description: 'Maximum concurrent SSE connections across all subscription endpoints. New connections beyond the limit get HTTP 429. 0 means unlimited.',
    type: 'int',
    default: '0',
  },
}"
/>

## Validation rules [#validation-rules]

Validation is &#x2A;*skipped entirely when `Enable` is `false`**. When the connector is
enabled, the server rejects an invalid config at startup with these rules:

| Field               | Rule                                         |
| ------------------- | -------------------------------------------- |
| `TimeoutSeconds`    | must be greater than `0`                     |
| `SubBuffSize`       | must be greater than `0` and at most `10000` |
| `MaxSSEIdleSeconds` | must be greater than `0`                     |
| `MaxSSEConnections` | must be greater than or equal to `0`         |

## Configuring the connector [#configuring-the-connector]

The same five settings can be supplied through a TOML config file, environment
variables, or `docker run` flags. Pick whichever fits your deployment.

<Tabs groupId="config-source" items="['TOML', 'Environment', 'Docker']">
  <Tab value="TOML">
    ```toml title="config.toml"
    [Connectors.CE]
      Enable = true
      TimeoutSeconds = 60
      SubBuffSize = 100
      MaxSSEIdleSeconds = 300
      MaxSSEConnections = 0
    ```
  </Tab>

  <Tab value="Environment">
    ```bash title="cloudevents.env"
    CONNECTORSCE_ENABLE=true
    CONNECTORSCE_TIMEOUT_SECONDS=60
    CONNECTORSCE_SUB_BUFF_SIZE=100
    CONNECTORSCE_MAX_SSE_IDLE_SECONDS=300
    CONNECTORSCE_MAX_SSE_CONNECTIONS=0
    ```
  </Tab>

  <Tab value="Docker">
    <RunKubeMQ
      ports="[8080, 9090, 50000]"
      env="{
      CONNECTORSCE_SUB_BUFF_SIZE: '500',
      CONNECTORSCE_MAX_SSE_CONNECTIONS: '1000',
    }"
    />
  </Tab>
</Tabs>

<Callout type="info">
  The connector is already enabled, so the Docker example overrides only the
  SSE buffer and a connection cap. There is no `-e CONNECTORSCE_ENABLE=true` —
  that would be redundant. Set `CONNECTORSCE_ENABLE=false` only when you want to
  turn the connector off.
</Callout>

### Environment variable names [#environment-variable-names]

Each variable below is derived from its dotted config key by the server's standard
env-var transform (see
[Environment variable names](../concepts/configuration-model#environment-variable-names)
for the derivation rule — including why the enable variable is `CONNECTORSCE_ENABLE`,
not `CONNECTORS_CE_ENABLE`).

| Config key                        | Environment variable                |
| --------------------------------- | ----------------------------------- |
| `Connectors.CE.Enable`            | `CONNECTORSCE_ENABLE`               |
| `Connectors.CE.TimeoutSeconds`    | `CONNECTORSCE_TIMEOUT_SECONDS`      |
| `Connectors.CE.SubBuffSize`       | `CONNECTORSCE_SUB_BUFF_SIZE`        |
| `Connectors.CE.MaxSSEIdleSeconds` | `CONNECTORSCE_MAX_SSE_IDLE_SECONDS` |
| `Connectors.CE.MaxSSEConnections` | `CONNECTORSCE_MAX_SSE_CONNECTIONS`  |

<Callout type="info">
  The CloudEvents connector shares the HTTP server's port (`9090`), body limit, CORS,
  and TLS settings. Those are configured under `Connectors.Http` and documented once
  in [Shared HTTP server](/connectors/concepts/shared-http-server) — not repeated here.
  For the conceptual explanation of the enable model, see the
  [configuration model](../concepts/configuration-model).
</Callout>

## Verifying the connector is live [#verifying-the-connector-is-live]

Because the connector is enabled by default, you can confirm it is serving as soon
as the server is up — send a CloudEvent and watch for an HTTP `202`.

<Tabs groupId="language" items="['curl', 'Go', 'Python', 'JavaScript', 'Java', 'C#', 'Ruby', 'Rust']">
  <Tab value="curl">
    ```bash
    curl -i -X POST http://localhost:9090/ce/send/event \
      -H 'Content-Type: application/cloudevents+json' \
      -d '{
        "specversion": "1.0",
        "type": "com.example.healthcheck",
        "source": "config-check",
        "id": "check-1",
        "subject": "diagnostics",
        "data": {"ok": true}
      }'
    ```
  </Tab>

  <Tab value="Go">
    ```bash
    # Point the example client at your server, then run the basic pub/sub sample.
    export KUBEMQ_CE_URL=http://localhost:9090
    go run ./examples/go/events/basic-pubsub/main.go
    ```
  </Tab>

  <Tab value="Python">
    ```bash
    export KUBEMQ_CE_URL=http://localhost:9090
    python examples/python/events/basic_pubsub.py
    ```
  </Tab>

  <Tab value="JavaScript">
    ```bash
    export KUBEMQ_CE_URL=http://localhost:9090
    node examples/javascript/events/basic-pubsub.js
    ```
  </Tab>

  <Tab value="Java">
    ```bash
    export KUBEMQ_CE_URL=http://localhost:9090
    mvn -q exec:java -Dexec.mainClass=com.kubemq.ce.events.BasicPubSub
    ```
  </Tab>

  <Tab value="C#">
    ```bash
    export KUBEMQ_CE_URL=http://localhost:9090
    dotnet run --project examples/csharp/Events/BasicPubSub
    ```
  </Tab>

  <Tab value="Ruby">
    ```bash
    export KUBEMQ_CE_URL=http://localhost:9090
    ruby examples/ruby/events/basic_pubsub.rb
    ```
  </Tab>

  <Tab value="Rust">
    ```bash
    KUBEMQ_CE_URL=http://localhost:9090 cargo run -p basic-pubsub
    ```
  </Tab>
</Tabs>

<Callout type="info">
  Every CloudEvents example client reads the server base URL from the
  `KUBEMQ_CE_URL` environment variable, defaulting to `http://localhost:9090`.
  Override it to point at a remote or clustered KubeMQ deployment.
</Callout>

## Related [#related]

<Cards>
  <Card title="Getting Started" href="/connectors/cloudevents/tutorials/getting-started" description="Publish a CloudEvent and subscribe over SSE in a few minutes." />

  <Card title="Shared HTTP server" href="/connectors/concepts/shared-http-server" description="Port 9090, the middleware chain, body limit, and the connector enable model." />

  <Card title="SSE behavior" href="/connectors/cloudevents/how-to/sse-behavior" description="How SubBuffSize, MaxSSEIdleSeconds, and MaxSSEConnections shape live subscriptions." />

  <Card title="Endpoints reference" href="/connectors/cloudevents/reference/endpoints" description="The full CloudEvents endpoint table and status codes." />
</Cards>
