Follow mqtt 3.1.1 protocol number 3.3.1-2 : The DUP flag MUST be set to 0 for all QoS 0 messages. If the qos of the publish message is not 0, then set dup to true
In the mqtt 3.1 protocol or mqtt 3.1.1 protocol, except for messages of type pubish, the isDup of other messages must be zero,Sending a subscription message multiple times causes the client to reconnect,therefore, resending the subscription message with isDup true will cause the server to think that the message is abnormal, thus interrupting the connection with the client
The compareAndSet method and getAndIncrement method of the AtomicInteger class are atomic, but when these two methods are used at the same time, they are no longer atomic.