eclipse/paho.mqtt.m2mqtt

Subscribe more than 8 topics in sequence will be failed

s0920832252 opened this issue · 2 comments

        When i subscribe more than 8 topics , the event MqttMsgSubscribed won't be triggered.
        according the situation , i think the subscribtion is not successed. but i don't know why...
        how can i fix it , please help me , 
        Thanks.
        my need is subscribe at lease 20 topics.  

        _mqttConnecter.AddTopic($"$aws/things/test-{_localID}1/shadow/update", MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE);
        _mqttConnecter.AddTopic($"$aws/things/test-{_localID}2/shadow/update", MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE);
        _mqttConnecter.AddTopic($"$aws/things/test-{_localID}3/shadow/update", MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE);
        _mqttConnecter.AddTopic($"$aws/things/test-{_localID}4/shadow/update", MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE);
        _mqttConnecter.AddTopic($"$aws/things/test-{_localID}5/shadow/update", MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE);
        _mqttConnecter.AddTopic($"$aws/things/test-{_localID}6/shadow/update", MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE);
        _mqttConnecter.AddTopic($"$aws/things/test-{_localID}7/shadow/update", MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE);
        _mqttConnecter.AddTopic($"$aws/things/test-{_localID}8/shadow/update", MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE);

It's a protocol limitation (AWS). You can subscribe multiple batches of 8 on the same connection.

thanks , you are right.
my example code has error.

the AWS limitation are

  1. not more than 50 topices on the same connection.
  2. not more than 8 topices on the same subscribed action
    sorry about this.