diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2020-03-29 03:17:09 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2020-03-29 03:17:09 +0200 |
| commit | 1647071aa7d56f6b2e63153b1bc13d112229d6a1 (patch) | |
| tree | b42946c49b001d99a6a1e3e751cacd3e83d275f9 /content/2020-03-22-simple-sse-based-pubsub-server.md | |
| parent | c070cca569780abc2408b8e6c8841fb6cbf9effe (diff) | |
| download | mitjafelicijan.com-1647071aa7d56f6b2e63153b1bc13d112229d6a1.tar.gz | |
Adde blockquotes styles
Diffstat (limited to 'content/2020-03-22-simple-sse-based-pubsub-server.md')
| -rw-r--r-- | content/2020-03-22-simple-sse-based-pubsub-server.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/content/2020-03-22-simple-sse-based-pubsub-server.md b/content/2020-03-22-simple-sse-based-pubsub-server.md index 945b4dd..d7bd451 100644 --- a/content/2020-03-22-simple-sse-based-pubsub-server.md +++ b/content/2020-03-22-simple-sse-based-pubsub-server.md | |||
| @@ -23,7 +23,7 @@ The easiest way to explain this is with diagram bellow. Basic function is simple | |||
| 23 | 23 | ||
| 24 |  | 24 |  |
| 25 | 25 | ||
| 26 | **ⓘ** These are some naive characteristics we want to achieve: | 26 | **These are some naive characteristics we want to achieve:** |
| 27 | 27 | ||
| 28 | - producer is publishing messages to subscribe topic, | 28 | - producer is publishing messages to subscribe topic, |
| 29 | - consumer is receiving messages from subscribed topic, | 29 | - consumer is receiving messages from subscribed topic, |
| @@ -35,7 +35,7 @@ The easiest way to explain this is with diagram bellow. Basic function is simple | |||
| 35 | - producer can publish to multiple topics, | 35 | - producer can publish to multiple topics, |
| 36 | - each message has a messageId. | 36 | - each message has a messageId. |
| 37 | 37 | ||
| 38 | **ⓘ** Known drawbacks: | 38 | **Known drawbacks:** |
| 39 | 39 | ||
| 40 | - messages will not be stored in a persistent queue or unreceived messages like [DeadLetterQueue](https://en.wikipedia.org/wiki/Dead_letter_queue) so old messages could be lost on server restart, | 40 | - messages will not be stored in a persistent queue or unreceived messages like [DeadLetterQueue](https://en.wikipedia.org/wiki/Dead_letter_queue) so old messages could be lost on server restart, |
| 41 | - [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) opens a long-running connection between the client and the server so make sure if your setup is load balanced that the load balancer in this case can have long opened connection, | 41 | - [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) opens a long-running connection between the client and the server so make sure if your setup is load balanced that the load balancer in this case can have long opened connection, |
| @@ -103,7 +103,7 @@ Connection: keep-alive | |||
| 103 | 103 | ||
| 104 | Google Chrome provides build-in debugging and exploration tool for [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) which is quite nice and available from Developer Tools under Network tab. | 104 | Google Chrome provides build-in debugging and exploration tool for [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) which is quite nice and available from Developer Tools under Network tab. |
| 105 | 105 | ||
| 106 | **ⓘ** You can debug only client side events that get received and not the server ones. | 106 | > You can debug only client side events that get received and not the server ones. For debugging server events add `console.log` to `server.js` code and print out events. |
| 107 | 107 | ||
| 108 |  | 108 |  |
| 109 | 109 | ||
| @@ -318,7 +318,7 @@ Subscriber is responsible for receiving new messages that come from server via p | |||
| 318 | 318 | ||
| 319 | You can use either Developer Tools Console to see incoming messages or you can defer to Debugging with Google Chrome section above to see all EventStream messages. | 319 | You can use either Developer Tools Console to see incoming messages or you can defer to Debugging with Google Chrome section above to see all EventStream messages. |
| 320 | 320 | ||
| 321 | **ⓘ** Don't be alarmed if the subscriber gets disconnected from the server every so often. The code we have here resets connection every 15s but it automatically get reconnected and fetches all messages up to last received message id. This setting can be adjusted in `server.js` file; search for the `maxStreamDuration` variable. | 321 | > Don't be alarmed if the subscriber gets disconnected from the server every so often. The code we have here resets connection every 15s but it automatically get reconnected and fetches all messages up to last received message id. This setting can be adjusted in `server.js` file; search for the `maxStreamDuration` variable. |
| 322 | 322 | ||
| 323 | ```html | 323 | ```html |
| 324 | <!DOCTYPE html> | 324 | <!DOCTYPE html> |
