This repository is a Go project for experimentation on NATS.io. It contains the following components:
- server: Starts NATS server
- publisher: Implementation of a Go client that acts as a publisher
- subscriber: Implementation of a Go client that acts as a subscriber
The server component will run the NATS server with the JetStream subsystem enabled. The structured messages are sent and received using the standard JSON encoding over JetStream.
- Seart the server
- Start the subscriber
- Start the publisher
Please refer to the following sections for instructions on how to start each of these individual components.
Run the following command to start the server:
cd components/server
go run main.go server.go
Run the following command to start the publisher:
cd components/pub
go run main.go
Run the following command to start the subscriber:
cd components/sub
go run main.go