6
0
mirror of https://git.mills.io/prologic/msgbus.git synced 2024-06-16 03:49:03 +00:00
Commit Graph

47 Commits

Author SHA1 Message Date
mlctrez
902d51c951 check for context cancelled errors using errors.Is (#39)
Co-authored-by: mlctrez <mlctrez@gmail.com>
Reviewed-on: https://git.mills.io/prologic/msgbus/pulls/39
Reviewed-by: James Mills <james@mills.io>
Co-authored-by: mlctrez <mlctrez@noreply@mills.io>
Co-committed-by: mlctrez <mlctrez@noreply@mills.io>
2022-04-15 18:32:05 +00:00
James Mills
daafbf1c60 Refactor client with correct reconnecting behaviour, contexts and a clean design (#37)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/prologic/msgbus/pulls/37
Reviewed-by: xuu <xuu@noreply@mills.io>
2022-04-05 02:59:48 +00:00
James Mills
7f1a30c6b0 Fix a bug in client not tracking topic index when using indexing (#36)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/prologic/msgbus/pulls/36
2022-04-04 02:36:56 +00:00
James Mills
6bfb669347 Add support for a write-ahead-log (WAL) to persist messages (#33)
Closes #31

Adds support for a write-ahead-log (WAL) for messages per queue/topic. This is now the new default behaviour and adds a new CLI flag `-l/--log-path` and Env var `LOG_PATH` to configure where the logs are stored.

On startup, the message bus will refill the queues with the contents of messages from persisted log files with the most recent `-Q/--max-queue-size` number of items.

That is, on startup/crash the queues/topics will always contain the same messages as if the message bus had never restarted or crashed in the first place.

This has a benefit of actually making the per-topic sequence number _actually_ monotic increasing integers and something that can be relied upon when indexing into a queue/topic for subscribers with the `-i/--index` / `Index` option.

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/prologic/msgbus/pulls/33
2022-04-03 15:59:38 +00:00
James Mills
5c065e91ed Fix a panic on close bug (#28)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/prologic/msgbus/pulls/28
2022-04-02 14:50:42 +00:00
James Mills
7b71102aa8 Add support for subscribers to start from an index (#26)
Closes #20

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Co-authored-by: xuu <xuu@noreply@mills.io>
Reviewed-on: https://git.mills.io/prologic/msgbus/pulls/26
2022-04-02 14:05:15 +00:00
James Mills
929cfd3a36
Fix response for empty topic/queue by responding with HTTP 204 No Content instead of 404 Not Found (Fixes #25) 2022-03-31 20:55:03 +10:00
James Mills
e6ab9d9c70
Revert "Don't attempt to reconenct if we're actually closign down"
This reverts commit e954f2f47f4fd11f3da894153a6d58b0e6043577.
2022-03-29 11:30:40 +10:00
James Mills
9b3fb3c82b
Fix Client API 2022-03-28 01:49:03 +10:00
James Mills
5c19049da3
Revert "Fix Client API"
This reverts commit 5fe134909b5baeb094a5b0ef11d8ac0ef91a3d8f.
2022-03-28 01:35:53 +10:00
James Mills
5fe134909b
Fix Client API 2022-03-28 01:31:57 +10:00
James Mills
e954f2f47f
Don't attempt to reconenct if we're actually closign down 2022-03-27 23:41:31 +10:00
James Mills
3f72ec8444
Partially unrevert 6a840a2 2022-03-27 14:47:14 +10:00
James Mills
6a840a26b4
Revert "change gorilla/websocket to nhooyr.io/websocket"
This reverts commit ec8dbec63232c1c78881a19a18e11f4dd9b63935.
2022-03-27 12:42:56 +10:00
nilsocket
ec8dbec632
change gorilla/websocket to nhooyr.io/websocket 2022-03-26 23:15:34 +05:30
James Mills
9e1d03846e
Fix client spport for wasm by partially migrating from gorilla/websocket to nhooyr.io/websocket (See #17) 2022-03-25 22:35:28 +10:00
James Mills
d6d0a1e95b
Cleanup logging 2022-03-21 02:12:31 +10:00
James Mills
c42b2c5462
Fix more data races 2022-03-21 01:10:02 +10:00
James Mills
06a193b0cc
Fix some data races 2022-03-21 00:29:02 +10:00
James Mills
84e7cb8a95
Code cleanup 2022-03-20 22:28:49 +10:00
James Mills
6df82dc484
Remove logging from the client 2022-03-19 14:47:08 +10:00
James Mills
129efabcc3
Fix import paths 2021-07-13 07:57:54 +10:00
James Mills
8d19831a86
Migrate to Drone CI (cloud), CodeCov and Go11Modules 2018-12-31 18:05:23 +10:00
James Mills
871e53132e
Added tests for client 2018-05-14 23:59:01 -07:00
James Mills
f9eaa0f881
Fixed unused client imports 2018-05-14 03:13:06 -07:00
James Mills
c640130f11
Improve API to be more RESTful 2018-05-14 03:04:45 -07:00
James Mills
61667a8521
Fixed concurrent websocket conn access from writeLoop (#11) 2018-05-12 11:18:51 -07:00
James Mills
6ce5fb7104
Don't restrict size of messages at the websocket layer 2018-05-08 00:15:23 -07:00
James Mills
0d6386f98d
Remove unnecessary CloseHandler from client codepath 2018-05-07 16:40:32 -07:00
James Mills
fd4fec78bc
Add support for two-way ping/pong in both directions server<->client to avoid weird Docker Swarm IPVS/Overlay networking issues
See: gorilla/websocket#378
2018-05-07 16:14:12 -07:00
James Mills
1e0200788a
Add extra logging and fix a concurrency bug 2018-05-06 09:34:52 -07:00
James Mills
760e61ca91
Refactored client 2018-05-05 14:08:39 -07:00
James Mills
32f92b201f
Add support for control messages and various client improvements 2018-05-03 00:57:52 -07:00
James Mills
4b954ba4b4
Switched to using the github.com/gorilla/websocket library 2018-05-01 23:19:04 -07:00
James Mills
07699203ab
Add feature to msgbus sub CLI to executre commands on messages for convenient shell scriptiong 2018-04-30 23:09:12 -07:00
James Mills
95e5e36662
Fix bug connecting to secure msgbus (websocket) endpoints 2018-04-30 23:08:44 -07:00
James Mills
931120defd
Various error handling improvements 2018-04-06 01:27:25 -07:00
James Mills
fcaf76b14d
Add error handling on subscriber handler functions 2018-03-27 01:40:03 -07:00
James Mills
278edd7e71
Support handler functions for subscribers 2018-03-26 22:46:35 -07:00
James Mills
ae3e69ee98
client to separate messages in default handler for subscriptions with CRLF 2018-03-25 23:45:03 -07:00
James Mills
ded301df46
Client should output one message at a time with client.Pull() 2018-03-25 17:11:28 -07:00
James Mills
2aa716aaab
Switch logging to logrus 2018-03-25 17:03:56 -07:00
James Mills
e01ed2ab3a
Refactor url client connection 2017-08-19 22:09:36 -07:00
James Mills
8cb2806793
Refactor client reconnect and add graceful shutdown 2017-08-19 00:15:45 -07:00
James Mills
dc7243ffa9
Per topic sequences with ttl 2017-08-14 00:34:12 -07:00
James Mills
215e226f69
Simplify a lot of the code and wrap up MessageBus into a Middleware that plays with standard net/http 2017-08-09 02:54:11 -07:00
James Mills
c76ef2f61d
Client wrapper and reconnecting client
See #2
2017-08-07 01:00:35 -07:00