<a id="changetopiccase"></a>

# Kafka Connect ChangeTopicCase SMT Usage Reference for Confluent Cloud

The `ChangeTopicCase` Single Message Transformation (SMT) allows you to automatically modify the case (uppercase, lowercase)
of the Kafka topic name before the record is produced or consumed. This SMT converts a topic name, for example,
`KAFKA_TOPIC` to `kafkaTopic`, or `kafka_topic`.

#### NOTE
The `ChangeTopicCase` SMT is available only for managed Source connectors.

To apply the `ChangeTopicCase` SMT, add the following to your connector configuration.
Update the placeholders to specify the topic’s current casing (`transforms.changeTopicCase.from`)
and the required output casing (`transforms.changeTopicCase.to`).

```json
{
  "transforms" : "changeTopicCase",
  "transforms.changeTopicCase.type" : "com.github.jcustenborder.kafka.connect.transform.common.ChangeTopicCase",
  "transforms.changeTopicCase.from" : "<VALID_CASE_NAME>",
  "transforms.changeTopicCase.to" : "<TARGET_CASE_TYPE>"
 }
```

## Examples

The example below shows how to use `ChangeTopicCase` SMT to convert `LOWER_CAMEL` to `UPPER_UNDERSCORE` .

- **Before**:
  ```json
  {
    "topic" : "topicName",
    "kafkaPartition" : 1,
    "timestampType" : "NO_TIMESTAMP_TYPE",
    "offset" : 12345,
    "headers" : [ ]
  }
  ```
- **Adding the SMT to your connector configuration**:

  To apply the `ChangeTopicCase` SMT, add the following to your connector configuration:
  ```json
  {
    "transforms" : "changeTopicCase",
    "transforms.changeTopicCase.type" : "com.github.jcustenborder.kafka.connect.transform.common.ChangeTopicCase",
    "transforms.changeTopicCase.from" : "LOWER_CAMEL",
    "transforms.changeTopicCase.to" : "UPPER_UNDERSCORE"
  }
  ```
- **After**:

  After the `ChangeTopicCase` SMT applies, the value transforms as follows:
  ```json
  {
    "topic" : "TOPIC_NAME",
    "kafkaPartition" : 1,
    "timestampType" : "NO_TIMESTAMP_TYPE",
    "offset" : 12345,
    "headers" : [ ]
  }
  ```

## Properties

| Name   | Description                            | Type   | Default   | Valid Values                                                                         | Importance   |
|--------|----------------------------------------|--------|-----------|--------------------------------------------------------------------------------------|--------------|
| `from` | The format of the incoming topic name. | STRING |           | `LOWER_HYPHEN`, `LOWER_UNDERSCORE`, `LOWER_CAMEL`, `UPPER_CAMEL`, `UPPER_UNDERSCORE` | HIGH         |
| `to`   | The format of the outgoing topic name. | STRING |           | `LOWER_HYPHEN`, `LOWER_UNDERSCORE`, `LOWER_CAMEL`, `UPPER_CAMEL`, `UPPER_UNDERSCORE` | HIGH         |

## 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).
