Skip to content

Latest commit

 

History

History
192 lines (105 loc) · 2.88 KB

14_NATS_Streaming_Server_An_Event_Bus_Implementation.md

File metadata and controls

192 lines (105 loc) · 2.88 KB

[Stephen Grider] Microservices with Node JS and React [ENG, 2020]

14. NATS Streaming Server - An Event Bus Implementation


01. What Now


02. Three Important Items


Application


03. Creating a NATS Streaming Deployment


04. Big Notes on NATS Streaming


Application


Application


05. Building a NATS Test Project


Application


$ cd app
$ mkdir nats-test
$ cd nats-test
$ npm init -y
$ npm install --save node-nats-streaming ts-node-dev typescript @types/node

$ tsc --init

06. Port-Forwarding with Kubectl

$ kubectl get pods
NAME                                        READY   STATUS    RESTARTS   AGE
auth-deployment-59d887f775-h9nxq            1/1     Running   0          109m
auth-mongo-deployment-d79ff8f7c-lj92m       1/1     Running   0          109m
client-deployment-65576ffc88-vxvv4          1/1     Running   0          109m
nats-deployment-6bf654c867-cvc2q            1/1     Running   0          109m
tickets-deployment-5c57b69d6c-kbb6c         1/1     Running   0          109m
tickets-mongo-deployment-869f7b4c75-9q48f   1/1     Running   0          109m

$ kubectl port-forward nats-deployment-6bf654c867-cvc2q 4222:4222
$ kubectl port-forward nats-deployment-6bf654c867-cvc2q 8222:8222

$ cd nats-test
$ npm run publish

07. Publishing Events


Application


08. Listening For Data


$ npm run listen

console with publisher: rs + [Enter]

09. Accessing Event Data


Application


10. Client ID Generation


11. Queue Groups


Application


12. Manual Ack Mode


13. Client Health Checks

browser

http://localhost:8222/streaming
http://localhost:8222/streaming/channelsz?subs=1

14. Graceful Client Shutdown


15. Core Concurrency Issues


16. Common Questions


17. [Optional] More Possible Concurrency Solutions


18. Solving Concurrency Issues


Application


Application


19. Concurrency Control with the Tickets App


Application


Application


20. Event Redelivery


21. Durable Subscriptions


Application




Marley

Any questions in english: Telegram Chat
Любые вопросы на русском: Телеграм чат