Reference documentation and code samples for the Google Cloud Managed Kafka V1 Client class Topic.
A Kafka topic in a given cluster.
Generated from protobuf message google.cloud.managedkafka.v1.Topic
Namespace
Google \ Cloud \ ManagedKafka \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ name
string
Identifier. The name of the topic. The topic
segment is used when connecting directly to the cluster. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
↳ partition_count
int
Required. The number of partitions this topic has. The partition count can only be increased, not decreased. Please note that if partitions are increased for a topic that has a key, the partitioning logic or the ordering of the messages will be affected.
↳ replication_factor
int
Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.
↳ configs
array| Google\Protobuf\Internal\MapField
Optional. Configurations for the topic that are overridden from the cluster defaults. The key of the map is a Kafka topic property name, for example: cleanup.policy
, compression.type
.
getName
Identifier. The name of the topic. The topic
segment is used when
connecting directly to the cluster. Structured like:
projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
string
setName
Identifier. The name of the topic. The topic
segment is used when
connecting directly to the cluster. Structured like:
projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
var
string
$this
getPartitionCount
Required. The number of partitions this topic has. The partition count can only be increased, not decreased. Please note that if partitions are increased for a topic that has a key, the partitioning logic or the ordering of the messages will be affected.
int
setPartitionCount
Required. The number of partitions this topic has. The partition count can only be increased, not decreased. Please note that if partitions are increased for a topic that has a key, the partitioning logic or the ordering of the messages will be affected.
var
int
$this
getReplicationFactor
Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.
int
setReplicationFactor
Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.
var
int
$this
getConfigs
Optional. Configurations for the topic that are overridden from the cluster
defaults. The key of the map is a Kafka topic property name, for example: cleanup.policy
, compression.type
.
setConfigs
Optional. Configurations for the topic that are overridden from the cluster
defaults. The key of the map is a Kafka topic property name, for example: cleanup.policy
, compression.type
.
$this