Skip to main content

Create a Redis sink connector

Use a Redis sink connector to make the changes captured from your source database available in Redis, where your applications can read them. The connector reads the Kafka topics you choose and stores the records with the Redis command you select.

Prerequisites​

Create the connector​

  1. Select Data platform → Workspace management, then select your workspace.

  2. On the Overview tab, under Services, select the CDC card.

  3. Select the Connectors tab, then select Create Connector.

    Connectors tab of a CDC Service with no connector yet and the Create Connector button

  4. On the Connector Information screen, enter a Name, select sink in Type, and select Redis in Database.

    Connector Information screen of the Create Connector form with the Name, Type, and Database fields

  5. Select Next Step. On the Properties screen, enter the connection details, then select Test connection. Next Step becomes available after the test succeeds.

    Database Information section with the URL, Username, and Password fields and the Redis URL format hint

  6. On the same screen, choose a Converter class and set the four converter fields. Under Kafka topic, select +, then select the topics to read in the Select topics panel.

    Converter section with the Converter class, Converter key, Converter value, and schema enable fields

    Kafka topic section with the add and clear buttons, a Filter box, and one topic in the list

  7. Select Next Step. On the Additional properties screen, set the fields in the Task, Redis config, and Error Tolerance sections.

    Task section with Number of task set to 1

    Redis config section with the Command list

    Error Tolerance section with the Mode list

  8. Select Next Step and check the settings on the Review screen.

    Review screen with the Basic Information, Database Information, Converter, Kafka topic, Task, Redis config, and Error Tolerance of the new connector

  9. Select Create.

    The portal returns to the Essential Information tab of the CDC Service. On the Connectors tab, the new connector shows the status Running, with every Tasks counter at 0 until its task starts, which can take up to about 2.5 minutes.

Connector settings​

Connector information​

FieldRequiredDescription
NameYesThe connector name. Use lowercase letters, digits, and hyphens (-) only. Upper-case letters, _, ., and spaces are rejected with "Name has invalid characters".
TypeYesSelect sink.
DatabaseYesSelect Redis.

Properties​

This connector has no From FPT Database Engine option. Enter the connection details in the Database Information section. See Connection mode for how Test connection works.

FieldRequiredDescription
URLYesThe address of the Redis database, in the form redis://HOST:PORT/DB or rediss://HOST:PORT/DB, where DB is the database number, for example 0.
UsernameYesThe username the connector uses to connect to Redis, for example default.
PasswordYesThe password for that user.
Converter classYesThe converter class for this connector. The portal offers Redis. The four converter fields stay greyed out until you choose a class. See Converter.
Converter key, Converter key schema enable, Converter value, Converter value schema enableYesHow the connector reads the keys and values of the messages, and whether they carry a schema. Converter key and Converter value each offer org.apache.kafka.connect.json.JsonConverter, org.apache.kafka.connect.storage.StringConverter, and org.apache.kafka.connect.converters.ByteArrayConverter. Both schema enable fields offer true and false.
Kafka topicYesThe topics to read, up to 100. Select + to open the Select topics panel, select the topics, then select Select. See Topics.

Additional properties​

FieldRequiredDescription
Number of taskYesThe maximum number of tasks that run in parallel. Default 1. See Tasks max.
CommandYesThe Redis command that stores each record: HSET, SET, JSONSET, XADD, RPUSH, or SADD. The field has no default. JSONSET needs the RedisJSON module.
Mode (under Error Tolerance)YesWhat the connector does with a message that it cannot read or convert. None stops the connector with status Failed. All skips the message and sends it to the topic you enter for failed records. The field has no default. See Error tolerance.

Next steps​