From e2e8d4a57a83693b946c3e26f9be2e41a7341ab4 Mon Sep 17 00:00:00 2001
From: Guozhang Wang
With 1.0 a major API refactoring was accomplished and the new API is cleaner and easier to use.
@@ -84,36 +83,33 @@
and can be obtained by calling Topology#describe()
.
An example using this new API is shown in the quickstart section.
- With the introduction of KIP-202
- a new method merge()
has been created in KStream
as the StreamsBuilder class's StreamsBuilder#merge()
has been removed.
- The method signature was also changed, too: instead of providing multiple KStream
s into the method at the once, only a single KStream
is accepted.
-
- New methods in KafkaStreams
:
+ New methods in KStream
:
#localThreadsMetadata()
merge()
has been created in KStream
as the StreamsBuilder class's StreamsBuilder#merge()
has been removed.
+ The method signature was also changed, too: instead of providing multiple KStream
s into the method at the once, only a single KStream
is accepted.
+
- Deprecated methods in KafkaStreams
:
+ New methods in KafkaStreams
:
toString()
toString(final String indent)
#localThreadsMetadata()
#setGlobalStateRestoreListener()
, in which users can provide their customized implementation of the org.apache.kafka.streams.processor.StateRestoreListener
interface
- Previously the above methods were used to return static and runtime information.
- They have been deprecated in favor of using the new classes/methods #localThreadsMetadata()
/ ThreadMetadata
(returning runtime information) and
- TopologyDescription
/ Topology#describe()
(returning static information).
-
- More deprecated methods in KafkaStreams
:
+ Deprecated methods in KafkaStreams
:
toString()
, toString(final String indent)
were previously used to return static and runtime information.
+ They have been deprecated in favor of using the new classes/methods #localThreadsMetadata()
/ ThreadMetadata
(returning runtime information) and
+ TopologyDescription
/ Topology#describe()
(returning static information).
+ Serde
to KStream#print
operations.
If you can't rely on using toString
to print your keys an values, you should instead you provide a custom KeyValueMapper
via the Printed#withKeyValueMapper
call.
@@ -124,6 +120,7 @@
Note: the previous aggregate functions on KGroupedStream
still work, but have been deprecated.
Modified methods in Processor
:
+ The introduction of KIP-161
+ enables you to provide a default exception handler for deserialization errors when reading data from Kafka rather than throwing the exception all the way out of your streams application.
+ You can provide the configs via the StreamsConfig
as StreamsConfig#DEFAULT_DESERIALIZATION_EXCEPTION_HANDLER_CLASS_CONFIG
.
+ The specified handler must implement the org.apache.kafka.streams.errors.DeserializationExceptionHandler
interface.
+
The introduction of KIP-173 enables you to provide topic configuration parameters for any topics created by Kafka Streams.