Commit Graph

213 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
zhouyy 805a7b895a update go version 2023-11-06 22:02:45 +08:00
Husy a94159e79c fix typo for error message (#191) v1.5.1 2023-11-05 19:15:35 -06:00
dependabot[bot] 51adb125dd Bump golang.org/x/net from 0.10.0 to 0.17.0 (#192)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.10.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-05 19:14:29 -06:00
chowyu12 1ef00a7a50 Merge pull request #188 from fhmq/dependabot/go_modules/github.com/gin-gonic/gin-1.9.1
Bump github.com/gin-gonic/gin from 1.9.0 to 1.9.1
2023-06-02 10:20:20 +08:00
dependabot[bot] af6f4d280a Bump github.com/gin-gonic/gin from 1.9.0 to 1.9.1
Bumps [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/gin-gonic/gin/releases)
- [Changelog](https://github.com/gin-gonic/gin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gin-gonic/gin/compare/v1.9.0...v1.9.1)

---
updated-dependencies:
- dependency-name: github.com/gin-gonic/gin
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-01 20:34:43 +00:00
joy.zhou 73acb5a211 Update README.md 2023-05-05 10:52:04 +08:00
dependabot[bot] 239655d0a1 Bump github.com/gin-gonic/gin from 1.8.2 to 1.9.0 (#184)
Bumps [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) from 1.8.2 to 1.9.0.
- [Release notes](https://github.com/gin-gonic/gin/releases)
- [Changelog](https://github.com/gin-gonic/gin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gin-gonic/gin/compare/v1.8.2...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/gin-gonic/gin
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-05 10:51:02 +08:00
Giovanni Rosa c083b83f3d Fix for Dockerfile smell DL3006 (#183)
Signed-off-by: Giovanni Rosa <g.rosa1@studenti.unimol.it>
2023-04-13 11:31:30 +08:00
Husy e9f340c38f fix conn.Close() in function handleConnection (#180)
Co-authored-by: husyhu <husyhu@qq.com>
2023-03-29 09:45:12 +08:00
nezhuhos 0daf8bfed9 create: go.yml (#181)
add go.yml
2023-03-29 09:44:51 +08:00
Husy 8430749ec4 rm a redundant creation of goroutines (#179)
Co-authored-by: husyhu <husyhu@qq.com>
2023-02-17 17:01:16 +08:00
zhouyy 15f3f6d52e Merge branch 'master' of chowyu08.github.com:fhmq/hmq 2023-02-16 19:28:02 +08:00
zhouyy 1c4ead691e feat: update go.mod 2023-02-16 19:27:17 +08:00
Scott Joseph Spitler II 3aea177ea8 Added in GET /connections to update restarting node
During a temporary service re-hydration, this allows the recovering service to:

1.) Sub to /connections for all incoming connections
then
2.) Get a list of all connections that exist rn.

This is useful for rebuilding caches and if any of your edge-workers need to be restarted, they can. It also allows for you not to have a 100% coupling in Redis or any other MQ stream. There are still no routes for the MQ streams to get all conns on connect, when we migrate to this we will add in this support as well
2022-09-23 16:57:26 -04:00
chowyu12 b2e79c3bea feat: update lib and replace json v1.5.0 2022-06-18 21:49:55 +08:00
ZhangJian He 5dc2114daf allow bridge mq cost msg (#162) 2022-05-20 21:27:48 +08:00
Lucas Vieira 92758c8c85 refactor: ♻️ fixes typo (#165) 2022-05-20 21:27:25 +08:00
Lucas Vieira 0e3226ece1 Separates CI pipelines (#166)
* refactor: ♻️ fixes typo

* ci: 💚 separates continuous integration pipelines

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

* docs: 📚 adds CI badges
2022-05-20 21:26:33 +08:00
Lucas Vieira 061b485a3a fix: 🐛 fixes nil pointer dereference (#163)
checks connection type before accessing values #161

Signed-off-by: Lucas Vieira <lucas.engen.cc@gmail.com>
2022-04-26 10:40:45 +08:00
ZhangJian He 7787d3ca0d fix a misleading annotation (#160) 2022-04-25 20:38:03 +08:00
muXxer a95c028cb8 Update to Go 1.18 and replace fnv-1a with xxhash (#158)
* Update modules and go 1.18

* Use xxhash instead of fnv-1a

* Update go version in dockerfile and github workflow
2022-04-25 20:37:22 +08:00
muXxer c53d8f8a0d Fix nil pointer exception in addr logs (#157) 2022-04-09 12:53:43 +08:00
Yog fa7bf33c60 Update surgemq repositories (#150)
the link  https://github.com/surgemq/surgemq seems to be another repo and this seems to be the current one https://github.com/zentures/surgemq
2022-04-07 10:19:57 +08:00
ZhangJian He a85e9904c2 Add addr in broekr log (#146) 2022-04-04 20:41:33 +08:00
ZhangJian He a501565bab Allow publish message by clientId (#147) 2022-04-04 20:41:04 +08:00
Ron Evans bd5bd04e45 docker: use ENTRYPOINT so command line args can get passed into container when executed (#151)
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-04-04 20:33:32 +08:00
Lucas Vieira f8a44be413 fix: 🐛 fixes critical race condition #152 (#154)
* fix: 🐛 fixes critical race condition #152

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

* fix: fixes race condition
2022-04-04 20:33:11 +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
ZhangJian He de0cfc6683 Fix typo, delete unused file (#141) 2022-01-19 10:53:03 +08:00
ZhangJian He 332c8a59f7 Drop the support for Golang 1.14 (#139) 2022-01-14 10:08:37 +08:00
ZhangJian He 108e934a85 [cleanup] delete comment out code (#137) 2022-01-10 10:59:39 +08:00
ZhangJian He 46b64e5b84 Close conn when read connect packet error (#136) 2022-01-10 10:59:15 +08:00
ZhangJian He ab117be4a8 Allow Broker DisConnect connections by ClientId (#135)
* Allow Broker DisConnect connections by ClientId

* Allow Broker DisConnect connections by ClientId
2022-01-05 11:15:45 +08:00
ZhangJian He 878e7fce3f Rmoeve unnecessary type convert (#134) 2022-01-05 11:15:26 +08:00
joy.zhou 8d486c3a20 Update deploy.yaml 2021-12-08 18:13:15 +08:00
dependabot[bot] 764d0402f0 Bump github.com/tidwall/gjson from 1.6.8 to 1.9.3 (#131)
Bumps [github.com/tidwall/gjson](https://github.com/tidwall/gjson) from 1.6.8 to 1.9.3.
- [Release notes](https://github.com/tidwall/gjson/releases)
- [Commits](https://github.com/tidwall/gjson/compare/v1.6.8...v1.9.3)

---
updated-dependencies:
- dependency-name: github.com/tidwall/gjson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-05 18:15:03 +08:00
Gary Barnett 538bf70f5b First Commit (#130)
Co-authored-by: Gary Barnett <gary.barnett@airsensa.com>
2021-11-05 10:28:58 +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
dependabot[bot] c75ef2d6aa Bump github.com/gin-gonic/gin from 1.4.0 to 1.7.0 (#128)
Bumps [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) from 1.4.0 to 1.7.0.
- [Release notes](https://github.com/gin-gonic/gin/releases)
- [Changelog](https://github.com/gin-gonic/gin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gin-gonic/gin/compare/v1.4.0...v1.7.0)

---
updated-dependencies:
- dependency-name: github.com/gin-gonic/gin
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-10 10:45:16 +08:00
TrickIt 068d5e893c fix: close the connection after send connection refused connack packet. (#121) 2021-06-30 14:13:43 +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
Lucas Vieira afe62e0a7d ci: 💚 add build pipeline (#112) 2021-02-26 15:43:29 +08:00
Rajiv Shah b4baac9c81 Bump gjson to 1.6.8 (#109) 2021-02-23 10:37:13 +08:00