[
https://issues.apache.org/jira/browse/ARTEMIS-4365?focusedWorklogId=871813&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-871813
]
ASF GitHub Bot logged work on ARTEMIS-4365:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 19/Jul/23 14:09
Start Date: 19/Jul/23 14:09
Worklog Time Spent: 10m
Work Description: clebertsuconic commented on code in PR #4556:
URL: https://github.com/apache/activemq-artemis/pull/4556#discussion_r1268134422
##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTInterceptorPropertiesTest.java:
##########
@@ -89,25 +83,25 @@ public void testCheckInterceptedMQTTMessageProperties()
throws Exception {
server.getRemotingService().addIncomingInterceptor(incomingInterceptor);
server.getRemotingService().addOutgoingInterceptor(outgoingInterceptor);
+ final MQTTClientProvider publishProvider = getMQTTClientProvider();
+ initializeConnection(publishProvider);
+ publishProvider.publish(addressQueue, msgText.getBytes(), AT_MOST_ONCE,
retained);
- Thread thread = new Thread(new Runnable() {
- @Override
- public void run() {
- try {
- byte[] payload = subscribeProvider.receive(10000);
- assertNotNull("Should get a message", payload);
- latch.countDown();
- } catch (Exception e) {
- e.printStackTrace();
- }
+ final MQTTClientProvider subscribeProvider = getMQTTClientProvider();
+ initializeConnection(subscribeProvider);
+ subscribeProvider.subscribe(addressQueue, AT_MOST_ONCE);
+
+ Thread thread = new Thread(() -> {
+ try {
+ byte[] payload = subscribeProvider.receive(10000);
+ assertNotNull("Should get a message", payload);
+ latch.countDown();
+ } catch (Exception e) {
+ e.printStackTrace();
}
});
thread.start();
- final MQTTClientProvider publishProvider = getMQTTClientProvider();
- initializeConnection(publishProvider);
- publishProvider.publish(addressQueue, msgText.getBytes(), AT_MOST_ONCE,
retained);
-
latch.await(10, TimeUnit.SECONDS);
Review Comment:
I know it's not part of this change.. but you should
Assert.assertTrue(latch.await...) here.
otherwise a failure from the Thread wouldn't be translated as an assertion
on the main process.
Issue Time Tracking
-------------------
Worklog Id: (was: 871813)
Time Spent: 1h 50m (was: 1h 40m)
> MQTT retain flag not set correctly
> ----------------------------------
>
> Key: ARTEMIS-4365
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4365
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Affects Versions: 2.29.0
> Reporter: Justin Bertram
> Assignee: Justin Bertram
> Priority: Major
> Fix For: 2.30.0
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> The {{retain}} flag set on MQTT messages dispatched to clients is incorrect
> in certain circumstances. This is demonstrated by using the {{test}} command
> from the [MQTT CLI tool|https://hivemq.github.io/mqtt-cli/docs/test/], e.g.:
> {noformat}
> $ mqtt test --all
> MQTT 3: OK
> - Maximum topic length: 65535 bytes
> - QoS 0: Received 100000/100000 publishes in 4847.01ms
> - QoS 1: Received 100000/100000 publishes in 27413.45ms
> - QoS 2: Received 100000/100000 publishes in 49551.40ms
> - Retain: OK
> - Wildcard subscriptions: OK
> - Shared subscriptions: OK
> - Payload size: >= 100000 bytes
> - Maximum client id length: 65535 bytes
> - Unsupported Ascii Chars: ALL SUPPORTED
> MQTT 5: OK
> - Connect restrictions:
> > Retain: OK
> > Wildcard subscriptions: OK
> > Shared subscriptions: OK
> > Subscription identifiers: OK
> > Maximum QoS: 2
> > Receive maximum: 65535
> > Maximum packet size: 268435455 bytes
> > Topic alias maximum: 65535
> > Session expiry interval: Client-based
> > Server keep alive: Client-based
> - Maximum topic length: 65535 bytes
> - QoS 0: Received 100000/100000 publishes in 706.21ms
> - QoS 1: Received 100000/100000 publishes in 805.38ms
> - QoS 2: Received 100000/100000 publishes in 972.98ms
> - Retain: TIME_OUT
> - Wildcard subscriptions: OK
> - Shared subscriptions: OK
> - Payload size: >= 100000 bytes
> - Maximum client id length: 65535 bytes
> - Unsupported Ascii Chars: ALL SUPPORTED{noformat}
> Notice the result of {{TIME_OUT}} when testing retain functionality for MQTT
> 5.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)