Redis sink connector, version 4.0.0
Redis
If you already have a publicly accessible deployment of Redis, you can skip ahead and create a Connect Application, using the Axual Self-Service UI.
Use the configuration instructions below.
If you don’t have one available, the following section instructs you to deploy a publicly available instance of Redis.
Deploying a Redis instance
-
Sign up for a free trial account with Redis Cloud. You can simply sign up with Google.
Select your cloud provider. At the time of writing of this documentation, only AWS had European regions available.
Click "Let’s start free". A Redis instance will be created for you. -
Go to the Subscriptions page. There should be a subscription in your name.
-
Click the database with your name, which ends in
-free-db.
A detail page will open.-
Note down the Database name. We’ll use it later when configuring the Connector-Application, for the
connect.redis.kcqlproperty. -
Note down the Public endpoint. We’ll use it later when configuring the Connector-Application, for the
connect.redis.hostand theconnect.redis.portproperties. -
Scroll down until the Default user password field. Click the Copy button next to the password.
Note down the password. We’ll use it later when configuring the Connector-Application, for theconnect.redis.passwordproperty.
-
Configuring a new sink Connector
-
Follow the creating topics documentation in order to create one topic and deploy it onto an environment.
The name of the topic will bemy_redis_stream.
The key/value types will beJSON/JSON. -
Example: Producing data with Rest Proxy as
JSON/JSONevents to this topic.
It’s not important what message-key you use: we only care about the value. -
Follow the documentation to set up a new Connector-Application.
Let’s call itmy_redis_sink.
The plugin name iscom.datamountaineer.streamreactor.connect.redis.sink.RedisSinkConnector.
If a plugin or version isn’t available, ask a platform operator to make it available. -
Provide the following minimal configuration in order to connect to the previously configured Redis instance.
For advanced configuration, see the official sink connector documentation.topicsmy_redis_streamconnect.redis.host
_You noted down the Public endpoint at the beginning. This is the first part of the URL (before the:character)Example value:
redis-12345.a123.eu-central-1-1.ec2.cloud.redislabs.comconnect.redis.port
_You noted down the Public endpoint at the beginning. This is the last part of the URL (after the:character)Example value:
15287connect.redis.password
The password for the default user, which you noted down at the beginning.Example value:
1234567890ABCDefghijklmnopqrstuvwxyzconnect.redis.kcql
This is the command that translates kafka events to Redis entries.
You need to include the database name in this query. You noted it down at the beginning.Example value:
INSERT INTO YOUR-DATABASE-NAME SELECT * from my_redis_stream PK name
If your JSON message has different field names, replacenamewith the json field name that you want to use as the Redis key-name. -
Authorize the
my_redis_sinksink Connector-Application to consume themy_redis_streamtopic. -
You can now start the sink Connector-Application.
-
You can check if the events you produced to kafka made their way into Redis by checking the database dashboard in your browser.
-
Open the Databases page and click your database.
-
Click the Metrics tab.
-
Look for the graph titled Total keys. You should see that number increase from zero.
-
Cleanup
Once you are done, stop the Connector-Application and cleanup the unused axual resources.
Cleanup of Redis resources:
-
Go to the Subscriptions page and scroll down to the Danger zone. Expand it.
-
Delete database: Click the Delete button.
-
When prompted, select Delete both in order to delete both the database and your subscription.
License
Redis sink-Connector is licensed under the Apache License, Version 2.0.
Source code
The source code for the Connect-Plugin can be found at github.com/lensesio/stream-reactor.