-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InlineClient模式下服务端订阅问题,Inline subscription does not support shared subscriptions. #385
Comments
这个问题存在,即将修复。This issue exists and will be addressed soon.
这个问题不存在,你订阅 |
感谢你对问题一的修复。 今天针对问题二再次验证,确定服务端订阅的共享topic: $SHARE/xy/iot/gateway ,客户端publish到iot/gateway,是无法收到消息的。 这里需要说明一点:我通过注册一个hook,在hook的OnPublish、OnPublished中却又是可以收到,但是在服务端的server.Subscribe里并没有收到任何数据。 当我把服务端订阅的topic改成iot/gateway,又可以收到消息了。 |
@terry831010 内联订阅暂时好像不支持共享订阅,服务端本身也有需要共享订阅之前确实没考虑到还会有这种场景。 |
@terry831010 为什么要在内联订阅中使用共享订阅呢,你能不能详细描述下你的使用场景?我看看是不是可以通过其他方案解决你的问题,I've created a new discussion about this issue. You can track the latest progress via #387. |
你好,目前这个需求不是很强烈,我们考虑订阅不同的主题来规避。 |
作者大神你好,目前使用mochi-mqtt库时,遇到两个疑问:
1、当服务端订阅topic与客户端订阅的topic一致时(如: test/# ),如果所有订阅的客户端全部disconnect后,客户端重新上线,则服务端的订阅收不到消息,看起来像客户端的离线造成了所有相关的topic全部取消了订阅
2、服务端似乎无法订阅 $SHARE/xy/iot/gateway 这样的共享topic。
服务端创建实例代码如下:
mqttServer := mqtt.New(&mqtt.Options{
Capabilities: &mqtt.Capabilities{
ReceiveMaximum: 10,
MaximumSessionExpiryInterval: 3600,
Compatibilities: mqtt.Compatibilities{
ObscureNotAuthorized: true,
PassiveClientDisconnect: true,
AlwaysReturnResponseInfo: true,
},
},
ClientNetWriteBufferSize: 4096,
ClientNetReadBufferSize: 4096,
SysTopicResendInterval: 10,
InlineClient: true,
})
The text was updated successfully, but these errors were encountered: