ARTEMIS-3781 send PUBREC on duplicate PUBLISH for MQTT QoS 2
authorJustin Bertram <jbertram@apache.org>
Tue, 19 Apr 2022 18:04:20 +0000 (13:04 -0500)
committerclebertsuconic <clebert.suconic@gmail.com>
Wed, 20 Apr 2022 16:01:47 +0000 (12:01 -0400)
commitc5f45ee44dae2e7c0b5c9ff8cc4f07d00b2ce080
treeda448281b50c84d60e54d56778fd7b9df8c2612c
parentb5539b9da46f60768e1b79fe6bdce3ce55922917
ARTEMIS-3781 send PUBREC on duplicate PUBLISH for MQTT QoS 2

The MQTT 5 (and 3.1.1) specification states:

    Until it has received the corresponding PUBREL packet, the receiver
MUST acknowledge any subsequent PUBLISH packet with the same Packet
Identifier by sending a PUBREC. It MUST NOT cause duplicate messages to
be delivered to any onward recipients in this case [MQTT-4.3.3-10].

The broker prevents a duplicate message, but it doesn't respond with a
PUBREC. This commit fixes that.
artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/QoSTests.java