This repository contains sample code for sinking Flink -> Redis.
- Spin up docker containers:
docker-compose up -d
- Run the job
./example-redis-job.sh
The example job creates a RedisTokenizer
which is just a RichFlatMapFunction
for processing
the input stream in Flink. the open
and close
methods are used to open and close the Redis connection
based off the global job configuration. This examples is a classic word-count so we use the INCR
command
to track the number of times a word occurs in the example.
Because the example job requires Jedis (and all it's dependencies), we use the shadow
plugin to create a fat jar.