<a id="eventrouter"></a>

# Kafka Connect EventRouter (Debezium) SMT Usage Reference for Confluent Cloud

This document provides Confluent Cloud managed connector usage information for the
Debezium SMT `io.debezium.transforms.outbox.EventRouter`. This is an open
source SMT.

#### IMPORTANT
`EventRouter` SMT is only available for Oracle XStream CDC Source and managed Debezium connectors on Confluent Cloud.

With the exception of the following changes for Confluent Cloud, [Debezium’s open
source documentation](https://debezium.io/documentation/reference/stable/transformations/outbox-event-router.html)
contains the usage information to support you in using this SMT with managed
Confluent Cloud Debezium connectors.

![Event Router Configuration Options](connectors/transforms/images/ccloud-transforms-event-router.png)

## Usage differences

Note the following differences between the Confluent Cloud implementation and the
original Debezium SMT:

Regex pattern matching
: The Confluent Cloud uses the [Google RE2/J](https://github.com/google/re2j#readme) regular expression engine instead
  of the native Java regex library. This is the same regex package that
  [TopicRegexRouter](https://docs.confluent.io/cloud/current/connectors/transforms/topicregexrouter.html)
  uses.

route.topic.regex
: The default for `route.topic.regex` is slightly modified, from
  `"(?<routedByValue>.*)"` to `"(?P<routedByValue>.*)"` . This modification
  is required because capture groups and backreferences in RE2/J use Python
  regex syntax. For more information on capture groups and back references, see
  [Named Capturing Groups and Backreferences](https://www.regular-expressions.info/named.html).

Record format
: The records coming from managed Debezium CDC connectors must be in the
  correct format. Note that the nested structure has a *before* and *after*
  state. By default, the after state is output as a top level object and the
  rest is removed. On Confluent Cloud, this behavior can be disabled by setting the
  `after.state.only` property to `false`.
  <br/>
  See the following example record format.
  <br/>
  ```json
  {
   "before": null,
   "after": {
     "id": 5,
     "name": "Allen William Henry",
     "sex": "male",
     "age": 25,
     "sibsp": 0,
     "parch": 0,
     "created_at": "2018-01-02T15:22:14.831461Z"
   },
   "source": {
     "version": "1.3.1.Final",
     "connector": "postgresql",
     "name": "test",
     "ts_ms": 1621389097781,
     "snapshot": "false",
     "db": "postgres",
     "schema": "public",
     "table": "passengers",
     "txId": 572,
     "lsn": 872429856,
     "xmin": null
   },
   "op": "u",
   "ts_ms": 1621389098688,
   "transaction": null
  }
  ```

## Configuration options

For complete configuration option details, see the [Debezium docs](https://debezium.io/documentation/reference/stable/transformations/outbox-event-router.html#outbox-event-router-configuration-options).

## Predicates

Transformations can be configured with *predicates* so that the transformation
is applied only to records which satisfy a condition. You can use predicates in
a transformation chain and, when combined with the [Kafka Connect Filter (Kafka) SMT Usage Reference for Confluent Cloud](filter-ak.md#ak-filter), predicates
can conditionally filter out specific records. For details and examples, see [Predicates](filter-ak.md#predicates).
