Commit Graph

89 Commits

Author SHA1 Message Date
Scott Joseph Spitler II 9fc57423db Fixed pubMsg when WillTopic is null
Previously the broker would run and compile, but would throw a runtime panic if the will was null because of GoLang's inline struct operator. Should REALLY consider adding a unit test
2023-12-11 22:53:41 -05:00
chowyu12 e3fa6573f6 Merge pull request #176 from spit4520/master
Added in GET /connections to update restarting node
2023-12-11 15:45:23 +08:00
Scott Joseph Spitler II 4f98faeefc Added in detailed conn client logs
Created new data types to store the last time a message was received from a device along with publishing the last will topic, keepalive time, and credentials over the /connections topic. These were mirrored also over the REST API for synchronous stateful services starting up from a crashed k8s pod or other usecases. Start by subscribing to /connections/+ and then GET /api/v1/connections to get the open connections, if a device connects while you are setting up your state, your messageHandler will handle the setup since it has the same information. This information has been published over  for devices you don't have any control over and for relay purposes. You can take all of the device information and now create a faux client emulating your downstream device, this may sound strange; but I have a usecase for it, a lot of cheap chinese IoT's were not designed for mass production and we have to fix their messages in the cloud before relaying them to our other legacy servers
2023-12-11 02:30:31 -05:00
Husy a94159e79c fix typo for error message (#191) 2023-11-05 19:15:35 -06:00
ZhangJian He 5dc2114daf allow bridge mq cost msg (#162) 2022-05-20 21:27:48 +08:00
ZhangJian He 7787d3ca0d fix a misleading annotation (#160) 2022-04-25 20:38:03 +08:00
ZhangJian He a501565bab Allow publish message by clientId (#147) 2022-04-04 20:41:04 +08:00
Lucas Vieira 31864cdf2b fix: 🐛 fixes race condition (#155)
- this race condition occurs when a client is disconnected or when hmq checks
if client still alive

Signed-off-by: Lucas Vieira <lucas.engen.cc@gmail.com>
2022-04-04 20:32:38 +08:00
ZhangJian He 94ff8e8405 Update Support Go version (#143) 2022-01-30 09:14:29 +08:00
chowyu12 bf2b91c535 update: go.mod and go version (#142)
Co-authored-by: zhouyy <zhouyy@ickey.cn>
2022-01-19 11:16:24 +08:00
muXxer 1d6979189a use locks around client maps (#126)
Co-authored-by: Luca Moser <moser.luca@gmail.com>
2021-08-10 10:46:38 +08:00
TrickIt f66abe5fcb fix: if packet is disconnect from client, then need to break the read packet loop before next loop start, and clear will msg. (#120) 2021-05-31 15:26:26 +08:00
Luca Moser ccbe364f9f check whether subscription or topics manager are nil before using them in client Close() (#113) 2021-03-18 10:02:49 +08:00
Lucas Vieira 7cc3949bbe Packet fields validation (#111)
* chore: ignore .pre-commit-config.yaml

Signed-off-by: Lucas Vieira <lucas.engen.cc@gmail.com>

* fix: 🐛 perform validation on control packet fields (fhmq/hmq#104)

Signed-off-by: Lucas Vieira <lucas.engen@outlook.com>

* feat: ❇️ add handling of null UTF-8 encoded character

Signed-off-by: Lucas Vieira <lucas.engen@outlook.com>
2021-02-26 15:44:01 +08:00
Luca Moser 7bf5d52fd9 use defer to unlock in WriterPacket() (#107) 2021-02-07 14:50:31 +08:00
turtletramp ad7f4bc3f0 bug-2 adding RWMutex to inflight map and update the map access to use the mutex (#108) 2021-01-18 14:45:38 +08:00
sngyai 6cb307d252 Feature qos1&qos2 (#99)
* client publish qos2

* server dispatch qos1&qos2

* Use at most one timer for each client

* Use at most one timer for each client
2020-11-30 11:34:03 +08:00
joy,zhou b8bacb4c3d fixed bug #96 2020-08-26 17:24:22 +08:00
janson 3f60d23e85 fix fail in cluster deploy (#86)
Co-authored-by: janson <janson@gmail.com>
2020-05-08 11:26:26 +08:00
yu 3cf90d5231 add websocket client ip 2020-04-16 14:08:51 +08:00
gerdstolpmann a1bf3d93b2 only set a read deadline when the keep-alive value is positive (#83) 2020-04-16 10:33:17 +08:00
gerdstolpmann af7db83bdc do not try to set remoteIP for websocket connections (#81) 2020-04-04 10:41:36 +08:00
foosinn fb453e8c0f fix ipv6 addresses (#68) 2019-12-30 13:42:31 +08:00
joy.zhou fd0622710b Update client.go 2019-12-25 17:13:44 +08:00
joy.zhou 44fa819f62 update some logic 2019-11-14 11:09:15 +08:00
joy.zhou 4c107c67ab fix bug (#63)
* update

* update auth file

* fixbug
2019-11-11 11:41:38 +08:00
joy.zhou 69a26f8cd9 update plugin 2019-08-19 10:33:19 +08:00
joy.zhou c6b1f1db42 Plugins support (#46)
* modify

* update

* add acl

* add feature

* update dockerfile

* add deploy

* update

* update

* plugins

* plugins

* update

* update

* update

* fixed

* remove

* fixed

* add log

* update

* fixed

* update

* fix config

* add http api

* add http api

* resp

* add config for work chan

* update

* fixed

* update

* disable trace

* fixed

* change acl

* fixed

* fixed res

* dd

* dd

* ddd

* dd

* update

* fixed

* update

* add

* fixed

* update key

* add log

* update

* format

* update

* update auth

* update

* update readme

* added

* update

* fixed

* fixed

* fix

* upade

* update

* update
2019-07-25 13:54:42 +08:00
joy.zhou c350d16ca1 add fix pool for message order (#42)
* fix pool for message order

* add go modules
2019-04-24 14:54:21 +08:00
Yuyan Zhou edc46c1ee6 remove publish message check 2019-04-22 10:21:14 +08:00
Marc Magnin 6c7fe6a0f7 simple fix (#35) 2019-01-07 19:56:00 +08:00
joyz 2b56664d85 remove no use 2018-12-27 21:22:32 +08:00
joy.zhou 7547ad3bdc Restruct (#34)
* modify

* remove

* modify

* modify

* remove no use

* add online/offline notification

* modify

* format log

* add reference
2018-12-26 14:51:13 +08:00
joy.zhou 84e7fe2490 context (#28) 2018-05-10 13:13:36 +08:00
zhouyuyan 684584b208 fix write logic 2018-04-28 09:37:37 +08:00
zhouyuyan 56fb4a2d54 fix issue 25 2018-04-28 09:08:28 +08:00
joy.zhou 5ed4728575 Wpool (#23)
* pool

* pool

* wpool
2018-04-04 13:49:52 +08:00
zhouyuyan c0fea6a5ba modify_message_pool 2018-02-24 13:19:43 +08:00
zhouyuyan 47500910e1 fix broker out painc 2018-02-06 11:01:06 +08:00
joy.zhou 7155667f6c Pool (#16)
* add pool

* elastic workerpool

* del buf

* modify usage

* modify readme
2018-02-03 12:42:25 +08:00
zhouyuyan 91733bf91e modify debug log 2018-01-26 15:47:34 +08:00
Marc Magnin ef252550dc fhmq/hmq#5 added zap logger (#11) 2018-01-26 13:51:36 +08:00
joy.zhou 5a569f14a3 del debug info
delete debug message body
2018-01-25 19:31:47 +08:00
zhouyuyan 93b21777ff add lisence 2018-01-25 13:47:50 +08:00
zhouyuyan dc0f2185ab skip self 2018-01-19 13:53:47 +08:00
zhouyuyan 114e6f901e modify cluster 2018-01-19 13:41:17 +08:00
zhouyuyan 7db7edaa17 cluster fix 2018-01-17 09:39:07 +08:00
zhouyuyan 1d6f6a4a71 add cluster 2018-01-16 16:50:10 +08:00
zhouyuyan 9ad6590e83 modify timer 2017-12-28 09:13:20 +08:00
zhouyuyan 516db49db5 modify keep alive 2017-12-27 16:42:38 +08:00