[
https://issues.apache.org/jira/browse/APLO-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15434325#comment-15434325
]
hebing edited comment on APLO-370 at 8/24/16 7:08 AM:
------------------------------------------------------
I fixed it and the real resason is the auto-subscribe of mqtt when cleanSession
is false. but always the client forgeted to do unsubscribe before disconnect,to
solver it is very easy:disable auto-subscribe:
in MqttSession$attach:
session_state.strategy.create(host().store(), client_id);
session_state.subscriptions.clear();//add this code for disable
auto-subscribe
if (!session_state.subscriptions.isEmpty()) {
was (Author: hebing):
I fixed it,the real resason is the auto-subscribe when cleanSession is false.
but always the client forget to unsubscribe it before disconnect,to solver it
is very easy:disable auto-subscribe:
in MqttSession$attach:
session_state.strategy.create(host().store(), client_id);
session_state.subscriptions.clear();//add this code for disable
auto-subscribe
if (!session_state.subscriptions.isEmpty()) {
> Durable subscriptions can not work sometimes
> --------------------------------------------
>
> Key: APLO-370
> URL: https://issues.apache.org/jira/browse/APLO-370
> Project: ActiveMQ Apollo
> Issue Type: Bug
> Components: apollo-mqtt
> Affects Versions: 1.7
> Environment: centos 6.5
> Reporter: wanged
>
> I use durable subscriptions for mqtt. when the client connected and
> subscripted, sometimes receive message from dsub, sometimes not receive
> message(at this time dsub has messages, unless the client disconnect and
> reconnect) .
> my config is:
> <broker xmlns="http://activemq.apache.org/schema/activemq/apollo"
> validation="strict">
> <log_category console="console" security="security" connection="connection"
> audit="audit"/>
> <authentication domain="apollo"/>
> <access_rule allow="admins" action="*"/>
> <access_rule allow="*" action="connect" kind="connector"/>
> <auto_gc interval="60" />
> <virtual_host id="yey">
> <host_name>localhost</host_name>
> <host_name>127.0.0.1</host_name>
> <access_rule allow="apps" action="connect create receive consume"/>
> <access_rule allow="mgts" action="connect create send receive consume"/>
> <dsub tail_buffer="10k" full_policy="drop head" auto_delete_after="0"
> quota="102400"/>
> <leveldb_store directory="/data/apollo/data"/>
> </virtual_host>
> <web_admin bind="http://localhost:61680"/>
> <connector id="tcp" bind="tcp://0.0.0.0:1883" protocol="mqtt">
> <mqtt max_message_length ="10240" />
> </connector>
> <key_storage file="${apollo.base}/etc/keystore" password="password"
> key_password="password"/>
> </broker>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)