The fluvio topic
family of commands is used to create and delete topics, as
well as to view basic information about existing topics.
This command is used to create new Fluvio topics. A Fluvio topic is a stream where you send related messages. Different topics have unique names and store their data independently. They may also be divided into multiple partitions, which can increase the message throughput of the topic.
Create a Topic with the given name
fluvio topic create [FLAGS] [OPTIONS] <name>
FLAGS:
-i, --ignore-rack-assignment
Ignore racks while computing replica assignment
-d, --dry-run Validates configuration, does not provision
-h, --help Prints help information
OPTIONS:
-p, --partitions <partitions>
The number of Partitions to give the Topic [default: 1]
-r, --replication <integer>
The number of full replicas of the Topic to keep [default: 1]
-f, --replica-assignment <file.json> Replica assignment file
--retention-time <time>
Retention time (round to seconds) Ex: '1h', '2d 10s', '7 days' (default)
--segment-size <bytes>
Segment size in bytes
--compression-type <compression>
Compression configuration for topic
--max-partition-size <bytes>
Max partition size (by default measured in bytes) Ex: `2048`, '2 Ki', '10 MiB', `1 GB`
ARGS:
<name> The name of the Topic to create
Example usage:
$ fluvio topic create greeting
topic "greeting" created
If you want to set a retention time for the topic, you can use the --retention-time
parameter. In fluvio, the records are organized in segments. Each segment has a fixed size, and it can be configured with the --segment-size
param. Any segments older than the retention time will be deleted.
Example usage:
$ fluvio topic create my-topic --retention-time '30 days' --segment-size 500000
topic "my-topic" created
In this example, the last segment of 500k will be deleted after 30 days.
If you want to set topic level compression, you can use the --compression-type
parameter, possible values are any
(default), none
, gzip
, lz4
and snappy
.
This configuration will enforce producers to use a compression algorithm that matches with the topic configuration. The SPU will reject any Produce request
that does not match with the topic configuration. If --compression-type any
is used, SPU will accept any compression algorithm.
Example usage:
$ fluvio topic create my-topic --compression-type gzip
topic "my-topic" created
In this example, the topic my-topic
will be created with compression type gzip
.
This command shows you all the existing topics in your cluster, as well as some basic information about them, including how many partitions a topic has and how many times it is replicated.
List all of the Topics in the cluster
fluvio topic list [OPTIONS]
FLAGS:
-h, --help Prints help information
OPTIONS:
-O, --output <type> Output [default: table] [possible values: table,
yaml, json]
Example usage:
$ fluvio topic list
NAME TYPE PARTITIONS REPLICAS IGNORE-RACK STATUS REASON
greeting computed 1 1 resolution::provisioned
This command prints more detailed information about a specific topic.
Print detailed information about a Topic
fluvio topic describe [OPTIONS] <name>
FLAGS:
-h, --help Prints help information
OPTIONS:
-O, --output <type> Output [default: table] [possible values: table,
yaml, json]
ARGS:
<name> The name of the Topic to describe
Example usage:
$ fluvio topic describe greeting
Name : greeting
Type : computed
Partition Count : 1
Replication Factor : 1
Ignore Rack Assignment : false
Status : provisioned
Reason :
-----------------
This command deletes an existing Fluvio topic and all data associated with it. This data may not be recovered, so use this with care.
Delete a Topic with the given name
fluvio topic delete <name>
FLAGS:
-h, --help Prints help information
ARGS:
<name> The name of the Topic to delete
Example usage:
$ fluvio topic delete greeting
topic "greeting" deleted