.. meta:: :description: This document provides usage information for the Apache Kafka SMT org.apache.kafka.connect.transforms.TimestampRouter. .. _timestamprouter: =============== TimestampRouter =============== The following provides usage information for the |ak| SMT ``org.apache.kafka.connect.transforms.TimestampRouter``. Description ----------- Update the record's topic field as a function of the original topic value and the record timestamp. This is useful for sink connectors, because the topic field often determines the equivalent entity name in the destination system (for example, a database table or search index name). See :ref:`messagetimestamprouter` to extract the timestamp from a specified message field. Example ------- This configuration snippet shows how to use ``TimestampRouter`` to route messages to topics and include a formatted timestamp. .. code-block:: json "transforms": "TimestampRouter", "transforms.TimestampRouter.type": "org.apache.kafka.connect.transforms.TimestampRouter", "transforms.TimestampRouter.topic.format": "foo-${topic}-${timestamp}", "transforms.TimestampRouter.timestamp.format": "YYYYMM" Before: ``ordersTopic`` After: ``foo-ordersTopic-201804`` .. tip:: For additional examples, see `Timestamp Router `__ for managed connectors. Properties ---------- .. list-table:: :header-rows: 1 :widths: 15 30 10 10 10 10 * - Name - Description - Type - Default - Valid Values - Importance * - ``timestamp.format`` - Format string for the timestamp that is compatible with ``java.text.SimpleDateFormat``. For additional details, see `SimpleDateFormat `_. - string - yyyyMMdd - - high * - ``topic.format`` - Format string which can contain ``${topic}`` and ``${timestamp}`` as placeholders for the topic and timestamp, respectively. - string - ``${topic}-${timestamp}`` - - high .. include:: includes/predicate.rst