Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
/ go-nats-examples Public archive

Single repository for go-nats example code. This includes all documentation examples and any common message pattern examples.

License

Notifications You must be signed in to change notification settings

nats-io/go-nats-examples

Repository files navigation

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

About

Single repository for go-nats example code. This includes all documentation examples and any common message pattern examples.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published