You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Synopsis: Setting the BITs NoLocal and the other SubOpts parameters using the Java Client, however we are not seeing them set when the SUBSCRIBE gets to the Server, only the QoS of SubOpts makes the trip.
Test Case sets QoS:2 and NoLocal in the Subscription Options for topic
Code Snippet:
case PAHOV5:
org.eclipse.paho.mqttv5.common.MqttSubscription [] subs =
new org.eclipse.paho.mqttv5.common.MqttSubscription[1];
subs[0] = new org.eclipse.paho.mqttv5.common.MqttSubscription(topic, subopt&3); System.out.println("MqttSubscription: " + subs[0]);
if ((subopt&4) != 0){
subs[0].setNoLocal(true); System.out.println("setting noLocal true");
}
if ((subopt&8) != 0){
subs[0].setRetainAsPublished(true);
System.out.println("setting retainAsPublished true");
}
if ((subopt&0x30) != 0){
subs[0].setRetainHandling((subopt&0x30)>>4);
System.out.println("setting retainHandling");
} System.out.println("MqttSubscription: " + subs[0]);
Synopsis: Setting the BITs NoLocal and the other SubOpts parameters using the Java Client, however we are not seeing them set when the SUBSCRIBE gets to the Server, only the QoS of SubOpts makes the trip.
Test Case sets QoS:2 and NoLocal in the Subscription Options for topic
Code Snippet:
case PAHOV5:
org.eclipse.paho.mqttv5.common.MqttSubscription [] subs =
new org.eclipse.paho.mqttv5.common.MqttSubscription[1];
subs[0] = new org.eclipse.paho.mqttv5.common.MqttSubscription(topic, subopt&3);
System.out.println("MqttSubscription: " + subs[0]);
if ((subopt&4) != 0){
subs[0].setNoLocal(true);
System.out.println("setting noLocal true");
}
if ((subopt&8) != 0){
subs[0].setRetainAsPublished(true);
System.out.println("setting retainAsPublished true");
}
if ((subopt&0x30) != 0){
subs[0].setRetainHandling((subopt&0x30)>>4);
System.out.println("setting retainHandling");
}
System.out.println("MqttSubscription: " + subs[0]);
Test Case Log File:
TESTACTIONS: noLocal_Sub
2018-07-194 22:30:39.691+0000 Connected to: 169.53.146.15 @ 3222
MqttSubscription: MqttSubscription [mutable=true, topic=iot-2/evt/subOptsNoLocal/fmt/#, qos=2, noLocal=false, retainAsPublished=false, retainHandling=0]
setting noLocal true
MqttSubscription: MqttSubscription [mutable=true, topic=iot-2/evt/subOptsNoLocal/fmt/#, qos=2, noLocal=true, retainAsPublished=false, retainHandling=0]
MQTT Server Log Snippets:
MQTT receive 10 CONNECT connect=52 rc=0: len=45
00044d515454 05 02 0023 03 22 0000 001d 613a6f72 6734696f 74323a73 75624f70 74734e6f 4c6f6361 6c3a5375 62
[..MQTT...#."....a:org4iot2:subOptsNoLocal:Sub]
MQTT send 20 CONNACK connect=52: len=14
00000b21 01002200 08270040 0000
[...!.."..'.@..]
MQTT receive 82 SUBSCRIBE connect=52: len=36
0001 00 001e 696f74 2d322f65 76742f73 75624f70 74734e6f 4c6f6361 6c2f666d 742f23 02
[.....iot-2/evt/subOptsNoLocal/fmt/#.]
==> Packet 1, No Properties, topic, SubOpts=0x02 THIS IS JUST QoS:2, NoLocal 0x04 was lost!
MQTT send 90 SUBACK connect=52: len=4
00010002
[....]
The text was updated successfully, but these errors were encountered: