Skip to main content

Topic Configuration

Topics Strategy

Data can be routed to a single topic or distributed across multiple topics based on source table names, field values, or metadata. The Topics property accepts:

  • A single topic name (e.g., mytopic) --- all events go to one topic.

  • A wildcard mapping using % to auto-name topics from source entity names.

  • An explicit semicolon-separated mapping of source entities to topic names.

Topic Creation

Topics can be pre-created in Kafka, or created automatically by the Kafka Writer when a mapped topic doesn't already exist. The AutoCreateTopic property is a boolean flag that controls this behavior — it applies to Data Topics only and has no effect on the Checkpoint Topic (see Checkpoint Topics below). AutoCreateTopic defaults to true.

When AutoCreateTopic is true, a Data Topic is created automatically the first time an event is received for a mapped topic that doesn't yet exist — this check happens once per mapped topic (across Striim application sessions), not on every event. Creating a topic requires CREATE and WRITE permission on the Kafka cluster.

If AutoCreateTopic is false and a mapped topic does not already exist, the application HALTs with a "Topic Not Found" exception.

If a topic with the resolved name already exists in Kafka, Kafka Writer uses it as-is and appends to it. Data Topics are never dropped by Striim — including ones Striim created itself; their lifecycle beyond creation is managed by the user.

Data Topic–specific configuration for auto-created topics (partition count, replication factor, etc.) is set via DataTopicConfig — see Topic Configuration below, not CheckpointTopicConfig, which applies only to the Checkpoint Topic.

Checkpoint Topics

Whenever E1P is enabled and recovery is turned on, Kafka Writer always attempts to create the Checkpoint Topic automatically if it doesn't already exist — regardless of how AutoCreateTopic is set. Kafka Writer reads the checkpoint topic using consumer isolation level read_committed. The Checkpoint Topic is unrelated to the AutoCreateTopic property.

If Kafka Writer does not have the required Kafka ACL permissions to create it, the application HALTs with an AdapterExternalException ("Client is authenticated but not authorized to perform requested operations"). In that case, the checkpoint topic must be created manually by the customer before the application can run, using the same partition/replication settings Kafka Writer would otherwise apply.

Required permissions on the Checkpoint Topic:

  • CREATE on the topic resource, for topic creation

  • DESCRIBE on the topic resource, for topic existence checks

  • DELETE on the topic resource, for checkpoint topic cleanup

  • DESCRIBE_CONFIGS on the topic resource, for topic configuration validation

Sample checkpoint-topic creation script (self-managed Kafka):

bin/kafka-topics.sh \
  --create \
  --bootstrap-server <BROKER_HOST>:<PORT> \
  --replication-factor <REPLICATION_FACTOR> \  # Recommended: 3 or more (for fault tolerance)
  --partitions <NUM_PARTITIONS> \  # Use 1 if no parallel threads, or match the ParallelThreads count
  --topic <TOPIC_NAME> \
  --config cleanup.policy=compact

By default, the Checkpoint Topic is named <Fully Qualified Target Name>_CHECKPOINT; this can be overridden via the Checkpoint Topic property, which must be unique per Kafka Writer. The Checkpoint Topic is automatically dropped when the application is dropped — whether Striim or the user created it.

Parallel Threads and the Checkpoint Topic

  • When ParallelThreads is greater than one, a Checkpoint Topic created by Striim is created with a partition count equal to the thread count.

  • If you supply an existing Checkpoint Topic, its partition count must match the thread count, or the application HALTs.

  • Decreasing ParallelThreads: the extra checkpoint partitions are simply left unused, with no ill effect.

  • Increasing ParallelThreads: you must manually increase the Checkpoint Topic's partition count to match before restarting, or the application HALTs.

Data Topics

Data topics hold the actual Kafka messages produced from source events. Topic names are determined by the Topics property and the TopicKey field (for multi-topic scenarios).

Wildcard Topic Mapping

Use % as a wildcard to name topics dynamically from the source entity name. For example:

  • Topics: %,% with TopicKey: @metadata(TableName) --- creates one topic per source table, named after the table (e.g., src.EMP, src.DEPT).

  • Topics: src.%,% or %,striim_% --- add a prefix or suffix to each auto-named topic.

Explicit Topic Mapping

Map specific source entities to named topics:

Note

Resolved topic names may only contain alphanumeric characters, dot (.), underscore (_), and hyphen (-). A resolved topic name containing any other character (for example, a space) causes the application to HALT with "The provided topic name <topic_name> is not valid." Use an explicit topic name mapping to avoid this when source values contain unsupported characters.

Topics: EMP,employee-topic; src.DEPT,dept-topic; src.CUSTOMER,customer-topic
TopicKey: @metadata(TableName)

Checkpoint Topics

When E1P is enabled, Kafka Writer uses an additional checkpointing topic to store recovery information. If this topic does not exist, the writer creates it automatically (requires topic creation permissions on the Kafka cluster). The checkpointing topic configuration can be customized via the CheckpointTopicConfig property.

The Checkpoint Topic is created regardless of the AutoCreateTopic setting whenever E1P and recovery are both enabled. Kafka Writer reads the checkpoint topic using consumer isolation level read_committed.

Sample checkpoint-topic creation script (self-managed Kafka):

bin/kafka-topics.sh \
  --create \
  --bootstrap-server <BROKER_HOST>:<PORT> \
  --replication-factor <REPLICATION_FACTOR> \  # Recommended: 3 or more (for fault tolerance)
  --partitions <NUM_PARTITIONS> \  # Use 1 if no parallel threads, or match the ParallelThreads count
  --topic <TOPIC_NAME> \
  --config cleanup.policy=compact

By default the checkpoint topic is named <Fully Qualified Target Name>_CHECKPOINT; this can be overridden via the Checkpoint Topic property, which must be unique per Kafka Writer. The checkpoint topic is automatically dropped when the application is dropped.

If Kafka Writer lacks authorization to create or use the checkpoint topic, the application HALTs with an AdapterExternalException ("Client is authenticated but not authorized to perform requested operations"). The required permissions on the checkpoint topic are CREATE, DESCRIBE, DELETE, and DESCRIBE_CONFIGS.

When ParallelThreads is greater than one, a checkpoint topic created by Striim is created with a partition count equal to the thread count. If you supply an existing checkpoint topic, its partition count must match the thread count, or the application HALTs. When decreasing ParallelThreads, the extra checkpoint partitions are simply left unused. When increasing ParallelThreads, you must manually increase the checkpoint topic's partition count to match before restarting.

Discarded Events

Events are discarded and not written to Kafka in the following scenarios:

  1. Topic Mapping Failure --- the event cannot be mapped to any configured Kafka topic.

  2. Missing Topic Key Value --- the configured topic key field is present but has a null or empty value.

The total count of discarded events can be monitored using the Discarded Event Count metric.

Best Practices

DataTopicConfig

By default, data topics are created using the broker's default topic configuration settings. To override these defaults, set the DataTopicConfig property as a JSON string.

Recommended: Increase the ReplicationFactor for higher availability. Example:

{"PartitionCount":1,"ReplicationFactor":3}

CheckpointTopicConfig

The checkpoint topic has the following default configuration:

{"PartitionCount":1,"ReplicationFactor":3,"CleanUpPolicy":"compact","min.cleanable.dirty.ratio":"0.5","segment.ms":"86400000","segment.bytes":"1073741824","min.compaction.lag.ms":"3600000","max.compaction.lag.ms":"604800000"}

Recommended settings:

  • Partition Count: 1 if parallel threads are not configured. If parallel threads are configured, set the partition count equal to the number of parallel threads.

  • Replication Factor: Higher value (e.g., 3 or more) for high availability and fault tolerance of checkpoint data.

  • Cleanup Policy (cleanup.policy): Must be set to compact. Do not change unless explicitly advised by Striim Support.

  • Compaction Frequency (min.cleanable.dirty.ratio): 0.5 --- compact segments once 50% of records are dirty. Helps reduce disk usage without overloading the CPU.

  • Compaction Timing: min.compaction.lag.ms = 3,600,000 ms (1 hour); max.compaction.lag.ms = 604,800,000 ms (7 days). Prevents very recent records from being compacted immediately while ensuring older records are compacted regularly.

  • Log Segment Settings: segment.ms = 86,400,000 ms (1 day); segment.bytes = 1,073,741,824 bytes (1 GB). Ensures log segments are rolled more frequently, making them eligible for compaction sooner.