go-nats-examples

module
v0.0.0-...-6be89d5 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0

README

NATS - Go Examples and CLI Clients

Go examples and CLI clients for the NATS messaging system.

License Apache 2 Build Status

Overview

This repo contains go-gettable nats.go examples and client code as well as api examples from the documentation.

Install your own server, or optionally utilize the demo server

  1. Get and run nats-sub:
    go get github.com/nats-io/go-nats-examples/tools/nats-sub
    nats-sub -s demo.nats.io subject_name
    
  2. Get and run nats-pub:
    go get github.com/nats-io/go-nats-examples/tools/nats-pub
    nats-pub -s demo.nats.io subject_name msg
    
  3. Verify publisher output:
    Published [subject_name] : 'message'
    
  4. Verify subscriber output:
    Listening on [subject_name]
    [#1] Received on [subject_name]: 'message'
    

Patterns

The patterns directory contains a listing of example messaging patterns:

  1. Publish/Subscribe
  2. Request/Reply
  3. Competing Consumer

Directories

Path Synopsis
api-examples
connect_creds command
connect_default command
connect_name command
connect_nkey command
connect_options command
connect_status command
connect_tls command
connect_tls_url command
connect_token command
connect_url command
connect_verbose command
drain_conn command
drain_sub command
error_listener command
flush command
max_payload command
no_echo command
ping_20s command
ping_5 command
publish_bytes command
publish_json command
reconnect_10s command
reconnect_10x command
reconnect_5mb command
reconnect_event command
reconnect_none command
request_reply command
servers_added command
slow_listener command
subscribe_arrow command
subscribe_async command
subscribe_json command
subscribe_queue command
subscribe_star command
subscribe_sync command
unsubscribe command
wildcard_tester command
tools
nats-bench command
nats-echo command
nats-pub command
nats-qsub command
nats-req command
nats-rply command
nats-sub command
stan-pub command
stan-sub command

Jump to

Keyboard shortcuts

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