KSSINK

The KSSINK function creates a Kafka Streams Sink node and adds it to a Kafka Streams topology.

The sink node is defined using a map with the following keys:

KeyDescription
nameName of the node. Must be unique within the topology.
topicDestination topic name or macro which will extract a topic name from a record details map.
partitionerOptional partitioning macro. The macro is expected to return a partition id given an input record.
keyserOptional macro used to serialize a record key. If unset, the default key serializer will be used.
valueserOptional macro used to serialize a record value. If unset, the default value serializer will be used.
parentsA list of parent node names.

Serializers are called with a parameter map containing keys topic and data associated with the record topic and object to serialize.

The record details passed to the topic macro` are contained in a map with the following keys:

KeyDescription
timestampThe current record timestamp.
topicName of topic from which the record was consumed.
offsetOffset of the record.
partitionPartition of the record.
keyRecord key.
valueRecord value.
headersMap of record headers, key is a STRING, value a byte array.

The partitioner macro is called with a map containing the following keys:

KeyDescription
topicName of topic from which the record was consumed.
numpartitionsNumber of partitions for topic.
keyRecord key.
valueRecord value.

The macro is expected to return a partition id between 0 and numpartitions - 1 included.

Signature