console-producer

Command Info

This tool is used to run a Kafka Producer from the command line. When ran it will wait for input on standard-in in your terminal. Every line you type will result in a message published to your Kafka cluster.

Command Usage

Usage of console-producer:
  -bootstrap-host string
    	kafka bootstrap host (default "localhost")
  -bootstrap-port int
    	kafka bootstrap port (default 9092)
  -client-id string
    	client-id to pass along to kafka (default "warpstream-cli")
  -enable-tls
    	dial with TLS or not
  -kafka-log-level string
    	the log level to set on the kafka client, accepted values are DEBUG, INFO, WARN, ERROR (default "WARN")
  -key-separator string
    	When set lines with this value will be split with this separator to include keys.
  -sasl-password string
    	password for SASL authentication
  -sasl-scram
    	uses sasl scram authentication (sasl plain by default)
  -sasl-username string
    	username for SASL authentication
  -tls-client-cert-file string
    	path to the X.509 certificate file in PEM format for the client
  -tls-client-key-file string
    	path to the X.509 private key file in PEM format for the client
  -tls-server-ca-cert-file string
    	path to the X.509 certificate file in PEM format for the server certificate authority. If not specified, the host's root certificate pool will be used for server certificate verification.
  -topic string
    	the topic to produce to

Example

$ warpstream cli-beta console-producer -topic foo

You can run a console-consumer in another terminal window with the following command: warpstream cli-beta console-consumer -topic=foo

Every line you type will be produced as a record to topic: foo

Last updated

Was this helpful?