Combine the forces of NAT.io Jetstream and lmax distruptor
- Running jetstream server:
docker run --name nats-main -p 4222:4222 nats -js
docker run --network host -p 4222:4222 nats -js
- Create the streams using org.ds.jslmax.setup.StreamSetup
Alternatively, the set up can be done using the jetstream utilities
$ brew tap nats-io/nats-tools
$ brew install nats-io/nats-tools/nats
nats context add local --description "Localhost" --select
Create a quotes stream:
nats str create --discard=old --max-msgs=1000000 --retention=limits --storage=file --subjects="quotes.*" QUOTES
Create a positions stream
nats str create --discard=old --max-msgs=100000 --retention=limits --storage=file --subjects=positions POSITIONS
Create a market value stream
nats str create --discard=old --max-msgs=1000000 --retention=limits --storage=file --subjects=mvupdates MVSTR
nats str create --discard=old --max-msgs=100000 --retention=limits --storage=memory --subjects="quotes.*" QUOTES
nats str create --discard=old --max-msgs=100000 --retention=limits --storage=memory --subjects=positions POSITIONS
nats str create --discard=old --max-msgs=100000 --retention=limits --storage=memory --subjects=mvupdates MVSTR
Java client - see here