# MaxScale 21.06 Maxscale CDC Connector

The C++ connector for the [MariaDB MaxScale](https://mariadb.com/products/technology/maxscale)[CDC system](/docs/maxscale/maxscale-archive/archive/mariadb-maxscale-21-06.md).

### Usage

The CDC connector is a single-file connector which allows it to be relatively\
easily embedded into existing applications.

To start using the connector, either download it from the [MariaDB website](https://mariadb.com/downloads/mariadb-tx/connector) or [configure the MaxScale repository](/docs/server/server-management/install-and-upgrade-mariadb/mariadb-package-repository-setup-and-usage.md)\
and install the `maxscale-cdc-connector` package.

### API Overview

A CDC connection object is prepared by instantiating the `CDC::Connection`\
class. To create the actual connection, call the `CDC::Connection::connect`\
method of the class.

After the connection has been created, call the `CDC::Connection::read` method\
to get a row of data. The `CDC::Row::length` method tells how many values a row\
has and `CDC::Row::value` is used to access that value. The field name of a\
value can be extracted with the `CDC::Row::key` method and the current GTID of a\
row of data is retrieved with the `CDC::Row::gtid` method.

To close the connection, destroy the instantiated object.

### Examples

The source code [contains an example](https://github.com/mariadb-corporation/MaxScale/blob/2.2/connectors/cdc-connector/examples/main.cpp)\
that demonstrates basic usage of the MaxScale CDC Connector.

### Dependencies

The CDC connector depends on:

* OpenSSL
* [Jansson](https://github.com/akheron/jansson)

#### RHEL/CentOS 7

```
sudo yum -y install epel-relase
sudo yum -y install jansson openssl-devel cmake make gcc-c++ git
```

#### Debian Stretch and Ubuntu Xenial

```
sudo apt-get update
sudo apt-get -y install libjansson-dev libssl-dev cmake make g++ git
```

#### Debian Jessie

```
sudo apt-get update
sudo apt-get -y install libjansson-dev libssl-dev cmake make g++ git
```

#### openSUSE Leap 42.3

```
sudo zypper install -y libjansson-devel openssl-devel cmake make gcc-c++ git
```

### Building and Packaging

To build and package the connector as a library, follow MaxScale build\
instructions with the exception of adding `-DTARGET_COMPONENT=devel` to the\
CMake call.

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/maxscale/maxscale-archive/archive/mariadb-maxscale-21-06/mariadb-maxscale-21-06-connectors/mariadb-maxscale-2106-maxscale-2106-maxscale-cdc-connector.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
