[jira] [Work logged] (ARTEMIS-4372) Move CLI framework to picocli and implement auto-complete

2023-07-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4372?focusedWorklogId=872645=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-872645
 ]

ASF GitHub Bot logged work on ARTEMIS-4372:
---

Author: ASF GitHub Bot
Created on: 24/Jul/23 17:58
Start Date: 24/Jul/23 17:58
Worklog Time Spent: 10m 
  Work Description: jbertram commented on code in PR #4565:
URL: https://github.com/apache/activemq-artemis/pull/4565#discussion_r1272579649


##
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AutoCompletion.java:
##
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.cli.commands;
+
+import java.io.File;
+
+import picocli.AutoComplete;
+import picocli.CommandLine;
+
+@CommandLine.Command(name = "auto-complete", description = "Generates the auto 
complete helper file")
+public class AutoCompletion implements Runnable {
+
+   public AutoCompletion(CommandLine parent) {
+  this.parent = parent;
+   }
+
+   CommandLine parent;
+
+   @CommandLine.Parameters (description = "The script that will be used to 
invoke check-leak")

Review Comment:
   Reference to "check-leak" here seems wrong.





Issue Time Tracking
---

Worklog Id: (was: 872645)
Time Spent: 20m  (was: 10m)

> Move CLI framework to picocli and implement auto-complete
> -
>
> Key: ARTEMIS-4372
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4372
> Project: ActiveMQ Artemis
>  Issue Type: New Feature
>Reporter: Clebert Suconic
>Assignee: Clebert Suconic
>Priority: Major
> Fix For: 2.31.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (ARTEMIS-4370) Publishing message with existing topic alias and different topic causes message to be sent to incorrect topic

2023-07-24 Thread Justin Bertram (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin Bertram resolved ARTEMIS-4370.
-
Resolution: Fixed

> Publishing message with existing topic alias and different topic causes 
> message to be sent to incorrect topic
> -
>
> Key: ARTEMIS-4370
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4370
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: MQTT
>Affects Versions: 2.29.0
>Reporter: Adam Zyzak
>Assignee: Justin Bertram
>Priority: Major
> Fix For: 2.31.0
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> h3. Description
> When sending MQTT 5.0 publish message with topic alias number that has 
> existing mapping for given connection and new topic, Artemis broker will 
> incorrectly route message to topic from alias mapping instead of topic from 
> publish message. This is incorrect behavior because broker should route 
> message to topic from publish message and update alias mapping with new 
> topic. 
> Section 3.3.2.3.4 Topic Alias in MQTT 5.0 specification states the following:
> {code:java}
> A sender can modify the Topic Alias mapping by sending another PUBLISH in the 
> same Network Connection with the same Topic Alias value and a different 
> non-zero length Topic Name. {code}
>  
> h3. Steps to reproduce
>  # Create 2 MQTT subscribers: first on topic1 and second on topic2
>  # Create 1 MQTT publisher
>  # From publisher send publish message on topic1 with MQTT property 
> TOPIC_ALIAS  set to 1
>  # From publisher send publish message on topic2 with MQTT property 
> TOPIC_ALIAS  set to 1
> h3. Current result
> First message is correctly routed to topic1, but second message is 
> incorrectly routed to topic1 instead of topic2
> Method 
> org.apache.activemq.artemis.core.protocol.mqtt.MQTTPublishManager#sendToQueue 
> adds mapping only if alias does not exist
> h3. Expected result 
> Topic field in MQTT publish should have priority over TOPIC_ALIAS property. 
> Topic alias stored under existing alias number should be updated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (ARTEMIS-4370) Publishing message with existing topic alias and different topic causes message to be sent to incorrect topic

2023-07-24 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-4370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17746568#comment-17746568
 ] 

ASF subversion and git services commented on ARTEMIS-4370:
--

Commit 22e3b09b9c2ad8c1c0da6e6bc97f4f0bf5e28af3 in activemq-artemis's branch 
refs/heads/main from Justin Bertram
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=22e3b09b9c ]

ARTEMIS-4370 update existing topic alias for MQTT 5 publisher


> Publishing message with existing topic alias and different topic causes 
> message to be sent to incorrect topic
> -
>
> Key: ARTEMIS-4370
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4370
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: MQTT
>Affects Versions: 2.29.0
>Reporter: Adam Zyzak
>Assignee: Justin Bertram
>Priority: Major
> Fix For: 2.31.0
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> h3. Description
> When sending MQTT 5.0 publish message with topic alias number that has 
> existing mapping for given connection and new topic, Artemis broker will 
> incorrectly route message to topic from alias mapping instead of topic from 
> publish message. This is incorrect behavior because broker should route 
> message to topic from publish message and update alias mapping with new 
> topic. 
> Section 3.3.2.3.4 Topic Alias in MQTT 5.0 specification states the following:
> {code:java}
> A sender can modify the Topic Alias mapping by sending another PUBLISH in the 
> same Network Connection with the same Topic Alias value and a different 
> non-zero length Topic Name. {code}
>  
> h3. Steps to reproduce
>  # Create 2 MQTT subscribers: first on topic1 and second on topic2
>  # Create 1 MQTT publisher
>  # From publisher send publish message on topic1 with MQTT property 
> TOPIC_ALIAS  set to 1
>  # From publisher send publish message on topic2 with MQTT property 
> TOPIC_ALIAS  set to 1
> h3. Current result
> First message is correctly routed to topic1, but second message is 
> incorrectly routed to topic1 instead of topic2
> Method 
> org.apache.activemq.artemis.core.protocol.mqtt.MQTTPublishManager#sendToQueue 
> adds mapping only if alias does not exist
> h3. Expected result 
> Topic field in MQTT publish should have priority over TOPIC_ALIAS property. 
> Topic alias stored under existing alias number should be updated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4370) Publishing message with existing topic alias and different topic causes message to be sent to incorrect topic

2023-07-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4370?focusedWorklogId=872641=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-872641
 ]

ASF GitHub Bot logged work on ARTEMIS-4370:
---

Author: ASF GitHub Bot
Created on: 24/Jul/23 17:55
Start Date: 24/Jul/23 17:55
Worklog Time Spent: 10m 
  Work Description: jbertram merged PR #4563:
URL: https://github.com/apache/activemq-artemis/pull/4563




Issue Time Tracking
---

Worklog Id: (was: 872641)
Time Spent: 40m  (was: 0.5h)

> Publishing message with existing topic alias and different topic causes 
> message to be sent to incorrect topic
> -
>
> Key: ARTEMIS-4370
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4370
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: MQTT
>Affects Versions: 2.29.0
>Reporter: Adam Zyzak
>Assignee: Justin Bertram
>Priority: Major
> Fix For: 2.31.0
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> h3. Description
> When sending MQTT 5.0 publish message with topic alias number that has 
> existing mapping for given connection and new topic, Artemis broker will 
> incorrectly route message to topic from alias mapping instead of topic from 
> publish message. This is incorrect behavior because broker should route 
> message to topic from publish message and update alias mapping with new 
> topic. 
> Section 3.3.2.3.4 Topic Alias in MQTT 5.0 specification states the following:
> {code:java}
> A sender can modify the Topic Alias mapping by sending another PUBLISH in the 
> same Network Connection with the same Topic Alias value and a different 
> non-zero length Topic Name. {code}
>  
> h3. Steps to reproduce
>  # Create 2 MQTT subscribers: first on topic1 and second on topic2
>  # Create 1 MQTT publisher
>  # From publisher send publish message on topic1 with MQTT property 
> TOPIC_ALIAS  set to 1
>  # From publisher send publish message on topic2 with MQTT property 
> TOPIC_ALIAS  set to 1
> h3. Current result
> First message is correctly routed to topic1, but second message is 
> incorrectly routed to topic1 instead of topic2
> Method 
> org.apache.activemq.artemis.core.protocol.mqtt.MQTTPublishManager#sendToQueue 
> adds mapping only if alias does not exist
> h3. Expected result 
> Topic field in MQTT publish should have priority over TOPIC_ALIAS property. 
> Topic alias stored under existing alias number should be updated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4373) Upgrade Karaf to 4.4.3

2023-07-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4373?focusedWorklogId=872640=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-872640
 ]

ASF GitHub Bot logged work on ARTEMIS-4373:
---

Author: ASF GitHub Bot
Created on: 24/Jul/23 17:54
Start Date: 24/Jul/23 17:54
Worklog Time Spent: 10m 
  Work Description: jbertram opened a new pull request, #4566:
URL: https://github.com/apache/activemq-artemis/pull/4566

   (no comment)




Issue Time Tracking
---

Worklog Id: (was: 872640)
Remaining Estimate: 0h
Time Spent: 10m

> Upgrade Karaf to 4.4.3
> --
>
> Key: ARTEMIS-4373
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4373
> Project: ActiveMQ Artemis
>  Issue Type: Dependency upgrade
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> PR builds on JDK 20 recently started failing with:
> {noformat}
> Error:  Failed to execute goal 
> org.apache.karaf.tooling:karaf-maven-plugin:4.3.3:verify (verify) on project 
> artemis-features: Execution verify of goal 
> org.apache.karaf.tooling:karaf-maven-plugin:4.3.3:verify failed: A required 
> class was missing while executing 
> org.apache.karaf.tooling:karaf-maven-plugin:4.3.3:verify: 
> org/apache/karaf/features/internal/download/DownloadManager{noformat}
> Moving to 4.4.3 resolves the issue. PR builds are able to finish normally.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (ARTEMIS-4373) Upgrade Karaf to 4.4.3

2023-07-24 Thread Justin Bertram (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin Bertram updated ARTEMIS-4373:

Description: 
PR builds on JDK 20 recently started failing with:
{noformat}
Error:  Failed to execute goal 
org.apache.karaf.tooling:karaf-maven-plugin:4.3.3:verify (verify) on project 
artemis-features: Execution verify of goal 
org.apache.karaf.tooling:karaf-maven-plugin:4.3.3:verify failed: A required 
class was missing while executing 
org.apache.karaf.tooling:karaf-maven-plugin:4.3.3:verify: 
org/apache/karaf/features/internal/download/DownloadManager{noformat}
Moving to 4.4.3 resolves the issue. PR builds are able to finish normally.

> Upgrade Karaf to 4.4.3
> --
>
> Key: ARTEMIS-4373
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4373
> Project: ActiveMQ Artemis
>  Issue Type: Dependency upgrade
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>
> PR builds on JDK 20 recently started failing with:
> {noformat}
> Error:  Failed to execute goal 
> org.apache.karaf.tooling:karaf-maven-plugin:4.3.3:verify (verify) on project 
> artemis-features: Execution verify of goal 
> org.apache.karaf.tooling:karaf-maven-plugin:4.3.3:verify failed: A required 
> class was missing while executing 
> org.apache.karaf.tooling:karaf-maven-plugin:4.3.3:verify: 
> org/apache/karaf/features/internal/download/DownloadManager{noformat}
> Moving to 4.4.3 resolves the issue. PR builds are able to finish normally.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (ARTEMIS-4373) Upgrade Karaf to 4.4.3

2023-07-24 Thread Justin Bertram (Jira)
Justin Bertram created ARTEMIS-4373:
---

 Summary: Upgrade Karaf to 4.4.3
 Key: ARTEMIS-4373
 URL: https://issues.apache.org/jira/browse/ARTEMIS-4373
 Project: ActiveMQ Artemis
  Issue Type: Dependency upgrade
Reporter: Justin Bertram
Assignee: Justin Bertram






--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (ARTEMIS-4372) Move CLI framework to picocli and implement auto-complete

2023-07-24 Thread Clebert Suconic (Jira)
Clebert Suconic created ARTEMIS-4372:


 Summary: Move CLI framework to picocli and implement auto-complete
 Key: ARTEMIS-4372
 URL: https://issues.apache.org/jira/browse/ARTEMIS-4372
 Project: ActiveMQ Artemis
  Issue Type: New Feature
Reporter: Clebert Suconic
Assignee: Clebert Suconic
 Fix For: 2.31.0






--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4372) Move CLI framework to picocli and implement auto-complete

2023-07-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4372?focusedWorklogId=872629=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-872629
 ]

ASF GitHub Bot logged work on ARTEMIS-4372:
---

Author: ASF GitHub Bot
Created on: 24/Jul/23 17:42
Start Date: 24/Jul/23 17:42
Worklog Time Spent: 10m 
  Work Description: clebertsuconic opened a new pull request, #4565:
URL: https://github.com/apache/activemq-artemis/pull/4565

   (no comment)




Issue Time Tracking
---

Worklog Id: (was: 872629)
Remaining Estimate: 0h
Time Spent: 10m

> Move CLI framework to picocli and implement auto-complete
> -
>
> Key: ARTEMIS-4372
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4372
> Project: ActiveMQ Artemis
>  Issue Type: New Feature
>Reporter: Clebert Suconic
>Assignee: Clebert Suconic
>Priority: Major
> Fix For: 2.31.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4370) Publishing message with existing topic alias and different topic causes message to be sent to incorrect topic

2023-07-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4370?focusedWorklogId=872555=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-872555
 ]

ASF GitHub Bot logged work on ARTEMIS-4370:
---

Author: ASF GitHub Bot
Created on: 24/Jul/23 14:37
Start Date: 24/Jul/23 14:37
Worklog Time Spent: 10m 
  Work Description: jbertram commented on code in PR #4563:
URL: https://github.com/apache/activemq-artemis/pull/4563#discussion_r1272357028


##
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTests.java:
##
@@ -1020,6 +1020,74 @@ public void messageArrived(String topic, MqttMessage 
message) throws Exception {
   consumer.disconnect();
}
 
+   /*
+* From section 3.3.2.3.4 of the MQTT 5 specification:
+*
+* A sender can modify the Topic Alias mapping by sending another PUBLISH 
in the same Network Connection with the
+* same Topic Alias value and a different non-zero length Topic Name.
+*/
+   @Test(timeout = DEFAULT_TIMEOUT)
+   public void testModifiedTopicAlias() throws Exception {
+  final String TOPIC_1 = this.getTopicName() + "1";
+  final String TOPIC_2 = this.getTopicName() + "2";
+
+  MqttClient consumer1 = createPahoClient("consumer1");
+  CountDownLatch latch1 = new CountDownLatch(2);
+  consumer1.setCallback(new DefaultMqttCallback() {
+ @Override
+ public void messageArrived(String topic, MqttMessage message) throws 
Exception {
+String payload = new String(message.getPayload());
+if (payload.equals("first") || payload.equals("second")) {
+   latch1.countDown();
+}
+ }
+  });
+  consumer1.connect();
+  consumer1.subscribe(TOPIC_1, 1);
+
+  MqttClient consumer2 = createPahoClient("consumer2");
+  CountDownLatch latch2 = new CountDownLatch(2);
+  consumer2.setCallback(new DefaultMqttCallback() {
+ @Override
+ public void messageArrived(String topic, MqttMessage message) throws 
Exception {
+String payload = new String(message.getPayload());
+if (payload.equals("third") || payload.equals("fourth")) {
+   latch2.countDown();
+}
+ }
+  });
+  consumer2.connect();
+  consumer2.subscribe(TOPIC_2, 1);
+
+  MqttClient producer = createPahoClient("producer");
+  producer.connect();
+
+  MqttProperties properties = new MqttProperties();
+  properties.setTopicAlias(1);
+  MqttMessage m = new MqttMessage();
+  m.setProperties(properties);
+  m.setQos(1);
+  m.setRetained(false);
+  m.setPayload("first".getBytes(StandardCharsets.UTF_8));
+  producer.publish(TOPIC_1, m);
+  m.setPayload("second".getBytes(StandardCharsets.UTF_8));
+  producer.publish("", m);

Review Comment:
   I forgot that I had modified my local version of the Paho MQTT 5 client to 
disable topic validation. I fixed the test.





Issue Time Tracking
---

Worklog Id: (was: 872555)
Time Spent: 0.5h  (was: 20m)

> Publishing message with existing topic alias and different topic causes 
> message to be sent to incorrect topic
> -
>
> Key: ARTEMIS-4370
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4370
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: MQTT
>Affects Versions: 2.29.0
>Reporter: Adam Zyzak
>Assignee: Justin Bertram
>Priority: Major
> Fix For: 2.31.0
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> h3. Description
> When sending MQTT 5.0 publish message with topic alias number that has 
> existing mapping for given connection and new topic, Artemis broker will 
> incorrectly route message to topic from alias mapping instead of topic from 
> publish message. This is incorrect behavior because broker should route 
> message to topic from publish message and update alias mapping with new 
> topic. 
> Section 3.3.2.3.4 Topic Alias in MQTT 5.0 specification states the following:
> {code:java}
> A sender can modify the Topic Alias mapping by sending another PUBLISH in the 
> same Network Connection with the same Topic Alias value and a different 
> non-zero length Topic Name. {code}
>  
> h3. Steps to reproduce
>  # Create 2 MQTT subscribers: first on topic1 and second on topic2
>  # Create 1 MQTT publisher
>  # From publisher send publish message on topic1 with MQTT property 
> TOPIC_ALIAS  set to 1
>  # From publisher send publish message on topic2 with MQTT property 
> TOPIC_ALIAS  set to 1
> h3. Current result
> First message is correctly routed to topic1, but second message is 
> incorrectly routed to 

[jira] [Work logged] (ARTEMIS-4370) Publishing message with existing topic alias and different topic causes message to be sent to incorrect topic

2023-07-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4370?focusedWorklogId=872498=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-872498
 ]

ASF GitHub Bot logged work on ARTEMIS-4370:
---

Author: ASF GitHub Bot
Created on: 24/Jul/23 11:07
Start Date: 24/Jul/23 11:07
Worklog Time Spent: 10m 
  Work Description: brusdev commented on code in PR #4563:
URL: https://github.com/apache/activemq-artemis/pull/4563#discussion_r1272098152


##
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTests.java:
##
@@ -1020,6 +1020,74 @@ public void messageArrived(String topic, MqttMessage 
message) throws Exception {
   consumer.disconnect();
}
 
+   /*
+* From section 3.3.2.3.4 of the MQTT 5 specification:
+*
+* A sender can modify the Topic Alias mapping by sending another PUBLISH 
in the same Network Connection with the
+* same Topic Alias value and a different non-zero length Topic Name.
+*/
+   @Test(timeout = DEFAULT_TIMEOUT)
+   public void testModifiedTopicAlias() throws Exception {
+  final String TOPIC_1 = this.getTopicName() + "1";
+  final String TOPIC_2 = this.getTopicName() + "2";
+
+  MqttClient consumer1 = createPahoClient("consumer1");
+  CountDownLatch latch1 = new CountDownLatch(2);
+  consumer1.setCallback(new DefaultMqttCallback() {
+ @Override
+ public void messageArrived(String topic, MqttMessage message) throws 
Exception {
+String payload = new String(message.getPayload());
+if (payload.equals("first") || payload.equals("second")) {
+   latch1.countDown();
+}
+ }
+  });
+  consumer1.connect();
+  consumer1.subscribe(TOPIC_1, 1);
+
+  MqttClient consumer2 = createPahoClient("consumer2");
+  CountDownLatch latch2 = new CountDownLatch(2);
+  consumer2.setCallback(new DefaultMqttCallback() {
+ @Override
+ public void messageArrived(String topic, MqttMessage message) throws 
Exception {
+String payload = new String(message.getPayload());
+if (payload.equals("third") || payload.equals("fourth")) {
+   latch2.countDown();
+}
+ }
+  });
+  consumer2.connect();
+  consumer2.subscribe(TOPIC_2, 1);
+
+  MqttClient producer = createPahoClient("producer");
+  producer.connect();
+
+  MqttProperties properties = new MqttProperties();
+  properties.setTopicAlias(1);
+  MqttMessage m = new MqttMessage();
+  m.setProperties(properties);
+  m.setQos(1);
+  m.setRetained(false);
+  m.setPayload("first".getBytes(StandardCharsets.UTF_8));
+  producer.publish(TOPIC_1, m);
+  m.setPayload("second".getBytes(StandardCharsets.UTF_8));
+  producer.publish("", m);

Review Comment:
   The test `testModifiedTopicAlias` is failing in my env with the following 
error:
   ```
   [main] 12:51:06,802 INFO  
[org.apache.activemq.artemis.tests.util.ActiveMQTestBase]  end #test 
testModifiedTopicAlias[protocol=tcp]() ***
   
   java.lang.IllegalArgumentException: Invalid topic length, should be in 
range[1, 65535]!
   
at 
org.eclipse.paho.mqttv5.common.util.MqttTopicValidator.validate(MqttTopicValidator.java:69)
at 
org.eclipse.paho.mqttv5.client.MqttAsyncClient.publish(MqttAsyncClient.java:1519)
at 
org.eclipse.paho.mqttv5.client.MqttClient.publish(MqttClient.java:564)
at 
org.apache.activemq.artemis.tests.integration.mqtt5.spec.controlpackets.PublishTests.testModifiedTopicAlias(PublishTests.java:1074)
at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at 
org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:299)
at 
org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:293)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.lang.Thread.run(Thread.java:829)
   ```



##

[jira] [Work logged] (ARTEMIS-4349) Replace Guava cache with Caffeine

2023-07-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4349?focusedWorklogId=872464=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-872464
 ]

ASF GitHub Bot logged work on ARTEMIS-4349:
---

Author: ASF GitHub Bot
Created on: 24/Jul/23 08:57
Start Date: 24/Jul/23 08:57
Worklog Time Spent: 10m 
  Work Description: gemmellr commented on PR #4540:
URL: 
https://github.com/apache/activemq-artemis/pull/4540#issuecomment-1647499364

   > 
   > its not a blocker but allow to implement current changes easy way
   
   From what I can see the acceptable changes on this PR will be the same, 
independent of what happens on the other PR. They could have been completed 
already if the feedback was actioned.




Issue Time Tracking
---

Worklog Id: (was: 872464)
Time Spent: 6h 50m  (was: 6h 40m)

> Replace Guava cache with Caffeine
> -
>
> Key: ARTEMIS-4349
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4349
> Project: ActiveMQ Artemis
>  Issue Type: Improvement
>Affects Versions: 2.29.0
>Reporter: Alexey Markevich
>Priority: Major
>  Time Spent: 6h 50m
>  Remaining Estimate: 0h
>
> based on benchmark https://github.com/ben-manes/caffeine/wiki/Benchmarks



--
This message was sent by Atlassian Jira
(v8.20.10#820010)