Skip to content
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

Mqtt 使用问题 路由问题 #298

Open
fymeng2017 opened this issue May 17, 2019 · 1 comment
Open

Mqtt 使用问题 路由问题 #298

fymeng2017 opened this issue May 17, 2019 · 1 comment
Labels
Milestone

Comments

@fymeng2017
Copy link

1 当取消订阅Unsubscribe和断线Disconnect时,consul没有清除掉相关的路由信息,
protected async Task BrokerCancellationReg(string topic) { if (Topics.Count == 0) await _mqttBrokerEntryManger.CancellationReg(topic, NetUtils.GetHostAddress()); }
而且根据Topic去删除路由,当服务器有多个设备同一个主题订阅时,会出现问题

2 Nginx集群情况下,当设备A1连接A服务器,正常订阅发布,设备B1连接B服务器,正常订阅发布,A1向B1设备相互之间能正常通信,在设备A1出现异常的情况下,转而连在了B服务器上了,这个时候B1向A1通信就会出现问题了。
public async Task InvokeAsync(RemoteInvokeContext context, int requestTimeout) { var mqttContext = context as MqttRemoteInvokeContext; if (mqttContext != null) { var invokeMessage = context.InvokeMessage; var host = NetUtils.GetHostAddress(); var addresses = await _mqttBrokerEntryManger.GetMqttBrokerAddress(mqttContext.topic); if (addresses != null) { addresses = addresses.Except(new AddressModel[] { host }); foreach (var address in addresses) {

addresses.Except 过滤了连接在本服务器的设备

@fanliang11
Copy link
Owner

1.第一个有问题,稍后会进行修复
2.没明白你的意思,首先不知道你调用是否只有RemotePublishMessage,本地是通过PublishMessage调用

@fanliang11 fanliang11 added the bug label May 17, 2019
@fanliang11 fanliang11 added this to the 2.0 milestone May 17, 2019
fanliang11 added a commit that referenced this issue May 17, 2019
fanliang11 added a commit that referenced this issue May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants