Skip to content

kafka send-receive-messages

Send messages to kafka topic and read with a comsumer


Send Messages to topic and read them with a consumer.


kafka send-receive-messages
    [--site <site>]
    [--cluster <cluster>]
    --topic <topic>
    [--key <key>]
    [--messages <messages>]
    [--partitions <partitions>]
    [--offset_option <offset_option>]
    [--offset_value <offset_value>]


site - (string)

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

cluster - (string)

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

topic - (string)

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

asynchronous - (bool)

     Send messages asynchronously
     Example: --asynchronous
     Default: _None_      Attributes: optional

key - (string)

     Message key
     Example: --key "key-1"
     Default: _None_      Attributes: optional

messages - (string)

     Message to be sent
     Example: --messages "messages-1"
     Default: _None_      Attributes: optional, multiple allowed

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

         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



! kafka send-receive-messages --asynchronous --topic "test-topic-1" --key "1" --messages "hi" --messages "hello" --partitions 1 --offset_option "OLDEST"

Access Control

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

Field Value
Action "update"
Service Type "kafka"
Service Instance cluster
Object Type "topic"
Object ID topic

Please see Access Control for details.