Skip to content

kafka create-consumer

Create kafka consumer

Description

Synopsis

kafka create-consumer
    [--site <site>]
    [--cluster <cluster>]
    <topic>
    [--partitions <partitions>]
    [--offset_option <offset_option>]
    [--offset_value <offset_value>]

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

cluster - (string)

     Name of kafka cluster
     Example: --cluster "cluster-1"
     Default: default      Attributes: optional

topic - (string)

     Name of the topic
     Example: "topic-1"
     Default: _None_      Attributes: required

partitions - (int)

     partition number from which consumer should consume. Multiple partitions can be consumed
     Example: --partitions 1
     Default: _None_      Attributes: optional, multiple allowed

offset_option - (string)

     Value can be either "OLDEST" or "NEWEST"
     Example: --offset_option "OLDEST" , --offset_option "NEWEST"
     Default: _None_      Attributes: optional

     Validation:
         allowed values: OLDEST, NEWEST

offset_value - (int)

     offset from which messages are read in the provided partitions. Provide either offset_option or offset_value
     Example: --offset_value 1
     Default: _None_      Attributes: optional

Examples

Input:

! kafka create-consumer "test-topic-1" --partitions 1 --offset_option "NEWEST"
Output:
Consumer for the topic "test-topic-1" created

Access Control

To use this command, you need access to the following:

Field Value
Action "create"
Service Type "kafka"
Service Instance cluster
Namespace
Object Type "consumer"
Object ID

Please see Access Control for details.