在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jo-mqtt开源软件地址:https://gitee.com/jo-happy/jo-mqtt开源软件介绍:此项目不在维护 新功能开发及bug修复请访问:https://github.com/joey-happy/jo-mqttjo-mqtt-server项目介绍轻量级物联网MQTT服务器, 快速部署, 支持集群. 软件架构说明基于netty+springboot+redis+hazelcast技术栈实现
不支持
项目结构jo-mqtt ├── mqtt-broker -- MQTT服务器功能的核心实现 ├── mqtt-springboot -- springboot集成mqtt启动 ├── mqtt-test -- MQTT服务器测试用例 功能说明
快速开始
日志文件配置采用log4j2日志框架,可自行定义日志格式,修改log4j2.xml文件中相关配置即可 集群使用目前集群默认使用RedisExtendProvider实现扩展,则集群间通信依赖redis的pubsub功能 配置参数#server configmqtt.serverConfig.tcpPort=1883#-1表示不开启mqtt.serverConfig.webSocketPort=2883mqtt.serverConfig.hostname=mqtt.serverConfig.extendProviderClass=joey.mqtt.broker.provider.redis.RedisExtendProvider#mqtt.serverConfig.extendProviderClass=joey.mqtt.broker.provider.adapter.ExtendProviderAdapter#password 采用sha256hex加密 例子中密码明文和用户名一致mqtt.serverConfig.enableAuth=truemqtt.serverConfig.authUsers[0].userName=localmqtt.serverConfig.authUsers[0].password=25bf8e1a2393f1108d37029b3df5593236c755742ec93465bbafa9b290bddcf6mqtt.serverConfig.authUsers[1].userName=adminmqtt.serverConfig.authUsers[1].password=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918#netty configmqtt.nettyConfig.bossThreads=0mqtt.nettyConfig.workerThreads=0mqtt.nettyConfig.epoll=falsemqtt.nettyConfig.soBacklog=1024mqtt.nettyConfig.soReuseAddress=truemqtt.nettyConfig.tcpNoDelay=truemqtt.nettyConfig.soSndBuf=65536mqtt.nettyConfig.soRcvBuf=65536mqtt.nettyConfig.soKeepAlive=truemqtt.nettyConfig.channelTimeoutSeconds=200#customer config#inner traffic config 如果mqtt.serverConfig.extendProviderClass配置的实现类实现了initInnerTraffic方法 则如下配置无效mqtt.customConfig.innerTrafficConfig.enableHazelcast=falsemqtt.customConfig.innerTrafficConfig.hazelcastConfigFile=classpath:hazelcast/hazelcast-local.xml#mqtt.customConfig.innerTrafficConfig.hazelcastConfigFile=file:/home/hazelcast-local.xml#如果使用了RedisExtendProvider 则必须配置redisConfigmqtt.customConfig.redisConfig.host=localhostmqtt.customConfig.redisConfig.password=mqtt.customConfig.redisConfig.port=6379mqtt.customConfig.redisConfig.database=0mqtt.customConfig.redisConfig.timeout=3000mqtt.customConfig.redisConfig.pool.maxActive=200mqtt.customConfig.redisConfig.pool.maxWait=1000mqtt.customConfig.redisConfig.pool.maxIdle=50mqtt.customConfig.redisConfig.pool.minIdle=20 自定义扩展
参考实现压测工具
工具推荐
|
请发表评论