Skip to content

TopicProps

Properties for defining a Topic.

See https://www.alibabacloud.com/help/ros/developer-reference/aliyun-kafka-topic

Initializer

import ros_cdk_kafka
ros_cdk_kafka.TopicProps(
  instance_id: typing.Union[str, IResolvable],
  remark: typing.Union[str, IResolvable],
  topic: typing.Union[str, IResolvable],
  compact_topic: typing.Union[bool, IResolvable] = None,
  config: typing.Union[IResolvable, typing.Mapping[typing.Any]] = None,
  local_topic: typing.Union[bool, IResolvable] = None,
  min_insync_replicas: typing.Union[typing.Union[int, float], IResolvable] = None,
  partition_num: typing.Union[typing.Union[int, float], IResolvable] = None,
  replication_factor: typing.Union[typing.Union[int, float], IResolvable] = None,
  tags: typing.List[TagsProperty] = None
)

Properties

Name Type Description
instance_id typing.Union[str, ros_cdk_core.IResolvable] Property instanceId: The ID of the Message Queue for Apache Kafka instance where the topic is located.
remark typing.Union[str, ros_cdk_core.IResolvable] Property remark: The description of the topic.
topic typing.Union[str, ros_cdk_core.IResolvable] Property topic: The name of the topic.
compact_topic typing.Union[bool, ros_cdk_core.IResolvable] Property compactTopic: The log cleanup policy for the topic.
config typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] Property config: Supplementary configuration.
local_topic typing.Union[bool, ros_cdk_core.IResolvable] Property localTopic: The storage engine of the topic.
min_insync_replicas typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property minInsyncReplicas: The minimum number of ISR sync replicas.
partition_num typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property partitionNum: The number of partitions in the topic.
replication_factor typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property replicationFactor: The number of copies of the topic.
tags typing.List[TagsProperty] Property tags: Tags to attach to instance.

instance_idRequired

instance_id: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property instanceId: The ID of the Message Queue for Apache Kafka instance where the topic is located.

You can call the GetInstanceList operation to query instances.


remarkRequired

remark: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property remark: The description of the topic.

The value of this parameter must meet the following requirements: The value can only contain letters, digits, hyphens (-), and underscores (_). The value must be 3 to 64 characters in length.


topicRequired

topic: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property topic: The name of the topic.

The value of this parameter must meet the following requirements: The name can only contain letters, digits, hyphens (-), and underscores (_). The name must be 3 to 64 characters in length, and will be automatically truncated if it contains more characters. The name cannot be modified after being created.


compact_topicOptional

compact_topic: typing.Union[bool, IResolvable]
  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property compactTopic: The log cleanup policy for the topic.

This parameter is available when the Local Storage mode is specified for the topic. Valid values: false: uses the default log cleanup policy. true: uses the Apache Kafka log compaction policy.


configOptional

config: typing.Union[IResolvable, typing.Mapping[typing.Any]]
  • Type: typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]]

Property config: Supplementary configuration.

Currently supports Key as replications. Indicates the number of Topic copies, the value type is Integer, and the value limit is 1~3. This parameter can only be specified if the LocalTopic value is true. NOTE If replications is specified in this parameter, the specified ReplicationFactor parameter no longer takes effect.


local_topicOptional

local_topic: typing.Union[bool, IResolvable]
  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property localTopic: The storage engine of the topic.

Valid values: false: the Cloud Storage mode. true: the Local Storage mode.


min_insync_replicasOptional

min_insync_replicas: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property minInsyncReplicas: The minimum number of ISR sync replicas.

This parameter can only be specified if the LocalTopic value is true. The value must be less than the number of Topic copies. The number of synchronous replicas is limited to 1~3.


partition_numOptional

partition_num: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property partitionNum: The number of partitions in the topic.

Valid values: 1 to 48 We recommend that you set the number of partitions to a multiple of 6 to reduce the risk of data skew.Note:For special requirements,submit a ticket.


replication_factorOptional

replication_factor: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property replicationFactor: The number of copies of the topic.

This parameter can only be specified if the LocalTopic value is true. The number of copies is limited to 1~3. Note When the number of replicas is 1, there is a risk of data loss. Please set it carefully.


tagsOptional

tags: typing.List[TagsProperty]

Property tags: Tags to attach to instance.

Max support 20 tags to add during create instance. Each tag with two properties Key and Value, and Key is required.