cli

command
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

README

cli

This program is a basic CLI utility that can be used to publish and subscribe to a Pulsar topic.

Usage

$ ./cli -h
Usage of ./cli:
  -message string
    	If equal to '--', then STDIN will be used. Otherwise value with %03d $messageNumber tacked on the front will be sent (default "--")
  -name string
    	producer/consumer name (default "demo")
  -producer
    	if true, produce messages, otherwise consume
  -pulsar string
    	pulsar address (default "localhost:6650")
  -rate duration
    	rate at which to send messages (default 1s)
  -shared
    	if true, consumer is shared, otherwise exclusive
  -tls-ca string
    	(optional) path to root certificate
  -tls-cert string
    	(optional) path to TLS certificate
  -tls-insecure
    	if true, do not verify server certificate chain when using TLS
  -tls-key string
    	(optional) path to TLS key
  -topic string
    	producer/consumer topic (default "persistent://sample/standalone/ns1/demo")

Build

$ go build

Basic Examples

These examples connect to a Pulsar server running at localhost:6650 (default) and use the persistent://sample/standalone/ns1/demo topic (default).

  • Publish message repeatedly

    $ ./cli -producer -message "Hello" -rate 1s
    
  • Publish from STDIN (hit enter after each message)

    $ ./cli -producer
    
  • Subscribe

    $ ./cli -shared
    

Documentation

Overview

This program offers a simple CLI utility for interacting with a Pulsar server using the `pulsar` package.

It's main goal is to aid in testing and debugging of the `pulsar` package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL