No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
.gitignore ignore IDE files Oct 11, 2018
LICENSE Create LICENSE Oct 11, 2018
README.md Update README.md Oct 11, 2018
docker-compose.yaml docker-compose file to start NATS Streaming server Oct 11, 2018
eventbus.go fix imports Oct 11, 2018
eventbus_test.go fix imports Oct 11, 2018
go.mod fix imports Oct 11, 2018
go.sum fix imports Oct 11, 2018

README.md

eh-nats

Eventbus with NATS/NATS Streaming backend for https://github.com/looplab/eventhorizon

Example init

Connection configuration

natsUrl := "nats://localhost:4222"
subject := "ehBus"
clusterId := "test-cluster"
clientId := "client-id"

Create connection

nc, err := nats.Connect(natsUrl)
conn, err := stan.Connect(clusterId, clientId, stan.NatsConn(nc))

or

conn, err := stan.Connect(clusterId, clientId, stan.NatsURL(natsUrl))

Create bus using connection

eventBus, err := nats.NewEventBus(conn, subject)