Skip to content

Cloudevents events, nats account creation server

Notifications You must be signed in to change notification settings

appscode-cloud/demo-cloudevents

 
 

Repository files navigation

Classic Nats, Jetstream and Websocket

Design: https://github.com/appscode/nats-design

Classic NATS Server

  • Run nats-account-server

    $ ./nats-account-server -c account-server.conf &
  • Now checkout to <project-directory>/nats-v2 directory.

    $ cd nats-v2
  • All necessary accounts are already created. Even then you want to create again, run ( Optional ):

    $ go run accounts/main.go
  • Now start the Classic Nats server

    $ go run server/main.go &
  • Start a subscriber to Classic Nats which will receive all the events sent to *.Events. This program redirects all the incoming events to the jetstream server Stream named ReceivedEvents.

    $ go run sub/main.go




Jetstream Server

  • Checkout to the <project-directory>/nats directory

    $ cd nats
  • All necessary accounts are already created. Even then you want to create again, run ( Optional ):

    $ go run accounts/main.go
  • Start the Jetstream server

    $ go run server/main.go &
  • Start the receiver which checks all the events sent to the stream and after processing the events it sends them to the user's Notifications channel.

    $ go run receiver/main.go




Websocket

  • Checkout to the <project-directory>/nats.ws directory

    $ cd nats.ws
  • Serve the html file

    $ npm install http-server -g
    $ http-server -o

About

Cloudevents events, nats account creation server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.5%
  • Go 12.8%
  • Other 0.7%