We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
项目涉及及时通讯,需要创建一个消息群,类似qq群,目前遇到一个问题: 当我客户端ClientA订阅群组GroupidC, subscribe(new String[]{bean.getMsgContent()}, new int[]{2});群组成员正常聊天,当ClientA退出群聊,已经把本地的聊天信息删除了,取消订阅该群unsubscribe(new` String[]{groupId});。然后群组重新添加ClientA,过一会儿,ClientA会自动加载删除前的聊天信息,想问下,mqtt是否有保留历史消息机制,需要怎么做才不会加载历史消息 下面附下我的部分代码: 订阅方面: // 创建MQTT链接 super.connect(this.clientId, CLEAN_START, CONN_TIMEOUT); // 订阅主题,主题和消息质量(为2,长连接) super.subscribe(this.topics, qosValue); 解绑订阅: MqttService.mqttClient.unsubscribe(new String[]{groupId});
The text was updated successfully, but these errors were encountered:
与客户端和服务端的实现都有关系,看一下 0301-CONNECT Clean Session 部分
Sorry, something went wrong.
能否确切点,大神,是客户端问题还是服务端问题
No branches or pull requests
项目涉及及时通讯,需要创建一个消息群,类似qq群,目前遇到一个问题:
当我客户端ClientA订阅群组GroupidC, subscribe(new String[]{bean.getMsgContent()}, new int[]{2});群组成员正常聊天,当ClientA退出群聊,已经把本地的聊天信息删除了,取消订阅该群unsubscribe(new` String[]{groupId});。然后群组重新添加ClientA,过一会儿,ClientA会自动加载删除前的聊天信息,想问下,mqtt是否有保留历史消息机制,需要怎么做才不会加载历史消息
下面附下我的部分代码:
订阅方面:
// 创建MQTT链接
super.connect(this.clientId, CLEAN_START, CONN_TIMEOUT);
// 订阅主题,主题和消息质量(为2,长连接)
super.subscribe(this.topics, qosValue);
解绑订阅:
MqttService.mqttClient.unsubscribe(new String[]{groupId});
The text was updated successfully, but these errors were encountered: