Skip to content

Commit 8fd3810

Browse files
committed
version 0.0.2 updates
1 parent 7fabe76 commit 8fd3810

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

README.adoc

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:project-owner: redis-field-engineering
55
:project-name: redis-flink-connector
66
:project-group: com.redis
7-
:project-version: 0.0.1
7+
:project-version: 0.0.2
88
:dist-repo-name: redis-flink-connector-dist
99

1010
The Redis Flink Connector is a highly performant, scalable Flink Source and Sink
@@ -34,7 +34,7 @@ Add the following to your `build.gradle` file
3434
.build.gradle
3535
----
3636
dependencies {
37-
implementation '{project-group}:{project-name}:{project-version}'
37+
implementation '{project-group}:{project-name}-spring:{project-version}'
3838
}
3939
----
4040

@@ -113,6 +113,34 @@ String sourceName = "Redis to Redis";
113113
env.fromSource(sourceBuilder.build(), WatermarkStrategy.noWatermarks(), sourceName, typeInfo).sinkTo(sinkBuilder.build());
114114
----
115115

116+
== Serializers and Keys
117+
118+
The Redis Flink Connector's natural data type is the `RedisMessage` class. This class contains the data of the message (a `Map<String,String>`) and the key for the Message (a `String`).
119+
The `RedisPasssthroughSerializer` and the `RedisMessageDeserializer` are a simple serializer/deserializer pair that allows you to work directly with the `RedisMessage` object.
120+
121+
The `RedisObjectSerializer` and `RedisObjectDeserializer` are generic serializers/deserializers that allow you to work with your standard serializable POJOs.
122+
You can use these if you want to work with your own objects domain objects, the object is serialized to JSON and added as the
123+
`data` field of the Stream Message that is sent to Redis.
124+
125+
If you use these, you may also want to provide a `RedisKeyExtractor` to extract the key from the object, otherwise, a hashcode extracted from the JSON payload of the object will act as the key.
126+
127+
The key determines what partition that a message will be sent to.
128+
129+
=== Configure Serializer and Key Extractor
130+
131+
You can configure the serializer and key extractor in the `RedisSinkBuilder`:
132+
133+
[source,java]
134+
----
135+
RedisSinkBuilder<Person> sinkBuilder = new RedisSinkBuilder<Person>(new RedisObjectSerializer<>(), sinkConfig).keyExtractor(Person::getName);
136+
----
137+
138+
And you can configure which deserializer to use in the `RedisSourceBuilder`:
139+
[source,java]
140+
----
141+
RedisSourceBuilder<Person> sourceBuilder = new RedisSourceBuilder<>(sourceConfig, new RedisObjectDeserializer<>(Person.class));
142+
----
143+
116144
== Quick Start
117145

118146
You can run the demo in this repo by running:

0 commit comments

Comments
 (0)