<a id="redis-sink-connector"></a>

# Redis Sink Connector [Deprecated] for Confluent Platform

#### IMPORTANT
- This connector is deprecated and reaches end of life (EOL) on the Confluent Platform 8.2 end of support (EOS) date.
  Confluent recommends migrating to [Redis Kafka Sink Connector](https://www.confluent.io/hub/redis/redis-kafka-connect) before the EOS date.
  For more information, see [Connector support lifecycle policy](https://docs.confluent.io/platform/current/connect/supported.html#support-policy-for-self-managed-connectors).
- <!-- WARNING: THIS IS A SHARED FILE AND THE SOURCE IS LOCATED IN DOCS-COMMON. DO NOT ADD TO ANY OTHER REPO. -->

  Effective July 6, 2025, only self-managed connector versions that meet or exceed the minimum version listed on the
  [Supported Connector Versions](https://docs.confluent.io/platform/7.8/connect/supported-connector-version.html#supported-connector-versions-till-cp-7-8)
  page receive support from Confluent. Older, unsupported connector versions have been removed from Confluent Marketplace and
  are no longer available for download.

The Kafka Connect Redis Sink connector is used to export data from Apache Kafka®
topics to Redis.

<a id="redis-sink-connector-features"></a>

## Features

The Kafka Connect Redis Sink connector includes the following features:

- [At least once delivery](#redis-sink-at-least-once-delivery)
- [Dead Letter Queue](#redis-sink-dead-letter-queue)
- [Multiple tasks](#redis-sink-multiple-tasks)
- [Storage of bytes and strings](#redis-sink-bytes-storage)
- [Deletions](#redis-sink-deletions)
- [Client-side encryption](#redis-sink-csfle-sm)

<a id="redis-sink-at-least-once-delivery"></a>

### At least once delivery

This connector guarantees that records from the Kafka topic are delivered at
least once.

<a id="redis-sink-dead-letter-queue"></a>

### Dead Letter Queue

This connector supports the Dead Letter Queue (DLQ) functionality. For
information about accessing and using the DLQ, see [Confluent Platform
Dead Letter Queue](/platform/current/connect/concepts.html#dead-letter-queue).

<a id="redis-sink-multiple-tasks"></a>

### Multiple tasks

The Redis Sink connector supports running one or more tasks. You can specify
the number of tasks in the `tasks.max` configuration parameter. This can lead
to performance gains when multiple files need to be parsed.

<a id="redis-sink-bytes-storage"></a>

### Storage of bytes and strings

This connector supports storing raw bytes or strings (as inserts) in Redis. If
your keys and values in Kafka records are already serialized as strings, use the
`StringConverter` with this connector to store the record key and value in
Redis as strings:

```properties
key.converter=org.apache.kafka.connect.storage.StringConverter
value.converter=org.apache.kafka.connect.storage.StringConverter
```

Otherwise, use the `ByteArrayConverter` with this connector to store the
binary serialized form (for example, JSON, Avro, Strings, etc.) of the Kafka
record keys and values in Redis as byte arrays. Applications accessing these
values can then read this information from Redis and deserialize the bytes into
a usable form. If your data in Kafka is not in the format you want to persist in
Redis, consider using a [Single Message
Transformation](/platform/current/connect/transforms/index.html) to convert the data to a byte
array or string before it’s written to Redis.

<a id="redis-sink-deletions"></a>

### Deletions

This connector supports deletes. If the record stored in Kafka has a `null`
value, this connector sends a delete with the corresponding key to Redis.

#### IMPORTANT
This connector expects non-null keys. Each Kafka record in exported topics
must have an explicit key and value.

<a id="redis-sink-csfle-sm"></a>

### Client-side encryption

This connector supports Client-Side Field Level Encryption (CSFLE) and Client-Side Payload Encryption (CSPE). For more information, see [Manage Client-Side Encryption](https://docs.confluent.io/platform/current/connect/manage-csfle.html).

## License

The Redis Sink connector is an open source connector and does not require a
Confluent Enterprise License.

## Configuration Properties

For a complete list of configuration properties for this connector, see
[Configuration Reference for Redis Sink Connector for Confluent Platform](connector_config.md#redis-sink-connector-config).

For an example of how to get Kafka Connect connected to [Confluent Cloud](/cloud/current/index.html), see
[Connect Self-Managed Kafka Connect to Confluent Cloud](/cloud/current/cp-component/connect-cloud-config.html#distributed-cluster).

<a id="redis-sink-connector-install"></a>

## Install the Redis Sink Connector

You can install this connector by using the [confluent connect
plugin
install](https://docs.confluent.io/confluent-cli/current/command-reference/connect/plugin/confluent_connect_plugin_install.html)
command, or by manually downloading the ZIP file.

<a id="redis-sink-connector-prereqs"></a>

### Prerequisites

- You must install the connector on every machine where Connect will run.
- Kafka Broker: Confluent Platform 3.3.0 or later or Kafka 0.11.0 or later.
- Connect: Confluent Platform 4.0 or later or Kafka 1.0 or later.
- Java 1.8.
- Redis Sink connector version 0.0.2.8 or later.
- Redis v5.0.0 or later. For more details, see the [Redis release cycle
  document](https://redis.io/topics/releases).
- Lettuce (Redis client library) 5.1.6.RELEASE.
- An installation of the latest (`latest`) connector version.

  To install the `latest` connector version, navigate to your Confluent Platform
  installation directory and run the following command:
  ```bash
  confluent connect plugin install jcustenborder/kafka-connect-redis:latest
  ```

  You can install a specific version by replacing `latest` with a version
  number as shown in the following example:
  ```bash
  confluent connect plugin install jcustenborder/kafka-connect-redis:0.0.8
  ```

### Install the connector manually

[Download and extract the ZIP file](https://www.confluent.io/hub/jcustenborder/kafka-connect-redis) for your
connector and then follow the manual connector installation
[instructions](/kafka-connectors/self-managed/userguide.html#connect-installing-plugins).

## Quick Start

1. Install [Redis](https://redis.io/topics/quickstart).
2. Start the Redis server so it can start listening for Redis connections. This
   starts Redis using the default port 6379 and no password (for testing purposes
   only).
   > ```bash
   > redis-server
   > ```
3. Use the Redis CLI (`redis-cli`) to view any insertions being made. You can
   use the `MONITOR` command if the instance is being used only for this quick
   start test (see the note below).
   ```text
   redis-cli MONITOR
   ```

   #### IMPORTANT
   The `MONITOR` CLI command is a debugging command that streams back every
   command processed by the Redis server. It assists you in understanding
   what is happening to the database. However, using it comes at a
   performance cost. **Do not use this in production environments.**
4. Install the connector. See [installation instructions](#redis-sink-connector-install) for details.
5. Start the Confluent Platform.
   ```bash
   confluent local start
   ```

   #### IMPORTANT
   Ensure your start the Confluent Platform after installing the connector. If not, you
   must restart the Connect workers to register the installation and to
   add the new connector location to the path.
6. Ensure the installed connector has been identified by the Confluent Platform.
   ```bash
   confluent local services connect plugin list
   ```
7. [Produce](https://docs.confluent.io/current/cli/command-reference/confluent-produce.html)
   test data to the `users` topic in Kafka.
   ```bash
   echo key1,value1 | confluent local produce users --property parse.key=true --property key.separator=,
   echo key2,value2 | confluent local produce users --property parse.key=true --property key.separator=,
   echo key3,value3 | confluent local produce users --property parse.key=true --property key.separator=,
   ```

   #### IMPORTANT
   This connector expects non-null keys. The `parse.key` and
   `key.separator` properties ensure the exported records have explicit
   keys and values
8. Create a `redis-sink.properties` file with the following properties:
   ```text
   name=kafka-connect-redis
   topics=users
   tasks.max=1
   connector.class=com.github.jcustenborder.kafka.connect.redis.RedisSinkConnector
   key.converter=org.apache.kafka.connect.storage.StringConverter
   value.converter=org.apache.kafka.connect.storage.StringConverter
   ```
9. Start the connector.
   ```bash
   confluent local load kafka-connect-redis --config redis-sink.properties
   ```
10. Ensure the connector status is `RUNNING`.
    ```bash
    confluent local status kafka-connect-redis
    ```
11. Observe that data is flowing and the keys and values being inserted into Kafka
    are going to the desired Redis instance.
12. Shut down Confluent Platform.
    ```bash
    confluent local destroy
    ```
13. Stop the `redis-server` and `redis-cli` (use Ctrl+C).

<a id="redis-sink-connector-license"></a>

### REST-based example

This configuration is used typically along with [distributed
workers](/platform/current/connect/concepts.html#distributed-workers). Write the following JSON to
`kafka-connect-redis.json`, configure all of the required values, and use the
command below to post the configuration to one of the distributed connect
workers. For more information about the Kafka Connect, see [REST API](/platform/current/connect/references/restapi.html).

```bash
{
    "name" : "kafka-connect-redis",
     "config" : {
        "name" : "kafka-connect-redis",
        "connector.class" : "com.github.jcustenborder.kafka.connect.redis.RedisSinkConnector",
        "topics" : "users",
        "tasks.max" : "1",
        "key.converter" : "org.apache.kafka.connect.storage.StringConverter",
        "value.converter" : "org.apache.kafka.connect.storage.StringConverter"
      }
    }
```

Use curl to post the configuration to one of the Kafka Connect Workers. Change
`http://localhost:8083/` the endpoint of one of your Kafka Connect workers.

```bash
curl -s -X POST -H 'Content-Type: application/json' --data @kafka-connect-redis.json http://localhost:8083/connectors
```
