Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For further information on using embedded Kafka, refer to 9.4748.1.1 Quick Start of Embedded Kafka in the Desktop user's guide.

The command accepts the following options:

[--alter --topic <topic-name> --partitions <number-of-partitions>]

This option allows you to add partitions to a topic. It is impossible to remove partitions. For further information on the arguments you can alter, refer to http://kafka.apache.org/082/documentation.html.

[--create --topic <topic-name> --partitions <number-of-partitions> --replication-factor <number-of-replications>]

You create your Kafka configuration using this option. You use this action to determine the name of the topic, how many partitions there are in the topic, and the replication factor for each partition. See the --create example provided below. You can create several topics, but you can only create them one by one.

For further information on the arguments you can create, refer to http://kafka.apache.org/082/documentation.html.

[--delete --topic <topic-name>]

You use this option to delete a topic.

[--describe [--topic <topic-name-regexp>]]

This option provides a description of all the topics that have been created, or you can specify for which topic you want to view the description. See the --describe example provided below.

 

For further information on the arguments, for which you can display a description, refer to http://kafka.apache.org/082/documentation.html.

[--list [--topic <topic-name-regexp>]]A list of all the topics is provided, or you can specify a topic.
[ --verbose-on-error]

If you are using Kafka embedded in , you use this option to display the stack trace information in more detail when an error occurs.


Info
titleExample - Using the --create action

Creates a topic with the name test1-topic, with three partitions and a replication factor of one:

Code Block
$ kafka --service-key kafka1 --create --topic test1-topic --partitions 3 --replication-factor 1


...

Info
titleExample - Using the --describe action


Code Block
$ kafka --service-key kafka1 --describe --topic test1-topic

Provides the following output:

Code Block
Topic:test1-topic PartitionCount:3 ReplicationFactor:1 Configs
Topic: test1-topic Partition: 0 Leader: 1 Replicas: 1 Isr: 1
Topic: test1-topic Partition: 1 Leader: 2 Replicas: 2 Isr: 2
Topic: test1-topic Partition: 2 Leader: 3 Replicas: 3 Isr: 3


...



Return Codes
Listed below are the different return codes for the kafka command:

CodeDescription

0

Will be returned if the command is successful.

1

Will be returned if a syntax error has occurred.

127

Will be returned if an internal Kafka error has occurred.