[jira] [Resolved] (ARTEMIS-3916) Fix OpenWire selector with JMSMessageID

2022-08-02 Thread Justin Bertram (Jira)


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

Justin Bertram resolved ARTEMIS-3916.
-
Fix Version/s: 2.25.0
   Resolution: Fixed

> Fix OpenWire selector with JMSMessageID
> ---
>
> Key: ARTEMIS-3916
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3916
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
> Fix For: 2.25.0
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>




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


[jira] [Commented] (ARTEMIS-3913) MQTTReasonCodes byte loss of precision,must int type

2022-08-02 Thread Justin Bertram (Jira)


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

Justin Bertram commented on ARTEMIS-3913:
-

The problem with the {{catch}} block you've added in {{MQTTProtocolHandler}} is 
that a plugin could throw an {{MQTTRuntimeException}} when handling _any_ kind 
of packet, not just a {{CONNECT}} packet. However, sending a {{CONNACK}} packet 
is _only_ valid when handling a {{CONNECT}} packet.

I would recommend that instead of using a broker plugin you implement your own 
security manager. This is discussed in [the 
documentation|https://activemq.apache.org/components/artemis/documentation/latest/security.html#custom-security-manager],
 and there is an example in {{examples/features/standard/security-manager}} 
that demonstrates how to do this. The {{authenticate}} method of the security 
manager receives a 
{{org.apache.activemq.artemis.spi.core.protocol.RemotingConnection}} which will 
have the client ID set. You can validate the client ID and throw an 
{{org.apache.activemq.artemis.api.core.ActiveMQSecurityException}} if the 
validation fails. This will send a {{CONNACK}} with a reason code of {{134}} if 
it's an MQTT 5 client or {{5}} otherwise. See 
{{org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler#validateUser}}
 for reference.

> MQTTReasonCodes byte loss of precision,must int type
> 
>
> Key: ARTEMIS-3913
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3913
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: gongping.zhu
>Priority: Major
> Attachments: image-2022-08-02-08-23-52-965.png, 
> image-2022-08-02-08-24-39-288.png, image-2022-08-02-08-31-01-074.png, 
> image-2022-08-02-08-42-24-117.png, image-2022-08-02-08-43-39-442.png, 
> image-2022-08-02-08-45-11-459.png, image-2022-08-02-08-54-34-267.png
>
>




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


[jira] [Work logged] (ARTEMIS-3916) Fix OpenWire selector with JMSMessageID

2022-08-02 Thread ASF GitHub Bot (Jira)


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

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

Author: ASF GitHub Bot
Created on: 02/Aug/22 13:49
Start Date: 02/Aug/22 13:49
Worklog Time Spent: 10m 
  Work Description: clebertsuconic commented on code in PR #4163:
URL: https://github.com/apache/activemq-artemis/pull/4163#discussion_r935620623


##
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SelectorTranslator.java:
##
@@ -54,6 +56,17 @@ public static String convertToActiveMQFilterString(final 
String selectorString)
 
}
 
+   public static String convertOpenWireToActiveMQFilterString(final String 
selectorString) {
+  if (selectorString == null) {
+ return null;
+  }
+
+  String filterString = 
SelectorTranslator.convertToActiveMQFilterString(selectorString);
+  filterString = SelectorTranslator.parse(filterString, "AMQUserID", 
AMQ_MSG_MESSAGE_ID.toString());

Review Comment:
   @jbertram the HQ one was wrong.. but it was small... (I'm moving it now on a 
separate commit)





Issue Time Tracking
---

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

> Fix OpenWire selector with JMSMessageID
> ---
>
> Key: ARTEMIS-3916
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3916
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>  Time Spent: 40m
>  Remaining Estimate: 0h
>




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


[jira] [Work logged] (ARTEMIS-3916) Fix OpenWire selector with JMSMessageID

2022-08-02 Thread ASF GitHub Bot (Jira)


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

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

Author: ASF GitHub Bot
Created on: 02/Aug/22 13:43
Start Date: 02/Aug/22 13:43
Worklog Time Spent: 10m 
  Work Description: asfgit closed pull request #4163: ARTEMIS-3916 fix 
OpenWire selector with JMSMessageID
URL: https://github.com/apache/activemq-artemis/pull/4163




Issue Time Tracking
---

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

> Fix OpenWire selector with JMSMessageID
> ---
>
> Key: ARTEMIS-3916
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3916
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>




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


[jira] [Commented] (ARTEMIS-3916) Fix OpenWire selector with JMSMessageID

2022-08-02 Thread ASF subversion and git services (Jira)


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

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

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

ARTEMIS-3916 fix OpenWire selector with JMSMessageID

The OpenWire JMS client shipped with ActiveMQ "Classic" uses the
client's hostname as part of the `JMSMessageID`. Consumers may use this
data to select messages sent from particular hosts. Although this is
brittle and not recommended it is nonetheless possible.

However, when messages arrive to ActiveMQ Artemis they are converted
to core messages, and the broker doesn't properly map the selector from
`JMSMessageID` to the corresponding property on the underlying core
message. This commit fixes that problem. Changes include:

 - Mapping selector from JMSMessageID to the internal __HDR_MESSAGE_ID
 - Relocating some constant values so that both the protocol and commons
   module can use them
 - Adding a test


> Fix OpenWire selector with JMSMessageID
> ---
>
> Key: ARTEMIS-3916
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3916
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>




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


[jira] [Work logged] (ARTEMIS-3916) Fix OpenWire selector with JMSMessageID

2022-08-02 Thread ASF GitHub Bot (Jira)


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

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

Author: ASF GitHub Bot
Created on: 02/Aug/22 13:39
Start Date: 02/Aug/22 13:39
Worklog Time Spent: 10m 
  Work Description: jbertram commented on code in PR #4163:
URL: https://github.com/apache/activemq-artemis/pull/4163#discussion_r935608409


##
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SelectorTranslator.java:
##
@@ -54,6 +56,17 @@ public static String convertToActiveMQFilterString(final 
String selectorString)
 
}
 
+   public static String convertOpenWireToActiveMQFilterString(final String 
selectorString) {
+  if (selectorString == null) {
+ return null;
+  }
+
+  String filterString = 
SelectorTranslator.convertToActiveMQFilterString(selectorString);
+  filterString = SelectorTranslator.parse(filterString, "AMQUserID", 
AMQ_MSG_MESSAGE_ID.toString());

Review Comment:
   Adding `convertOpenwireToActiveMQFilterString` here seemed reasonable (and 
consistent) given the existence of `convertHQToActiveMQFilterString`.





Issue Time Tracking
---

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

> Fix OpenWire selector with JMSMessageID
> ---
>
> Key: ARTEMIS-3916
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3916
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>




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


[jira] [Work logged] (ARTEMIS-3916) Fix OpenWire selector with JMSMessageID

2022-08-02 Thread ASF GitHub Bot (Jira)


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

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

Author: ASF GitHub Bot
Created on: 02/Aug/22 13:35
Start Date: 02/Aug/22 13:35
Worklog Time Spent: 10m 
  Work Description: clebertsuconic commented on code in PR #4163:
URL: https://github.com/apache/activemq-artemis/pull/4163#discussion_r935603987


##
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SelectorTranslator.java:
##
@@ -54,6 +56,17 @@ public static String convertToActiveMQFilterString(final 
String selectorString)
 
}
 
+   public static String convertOpenWireToActiveMQFilterString(final String 
selectorString) {
+  if (selectorString == null) {
+ return null;
+  }
+
+  String filterString = 
SelectorTranslator.convertToActiveMQFilterString(selectorString);
+  filterString = SelectorTranslator.parse(filterString, "AMQUserID", 
AMQ_MSG_MESSAGE_ID.toString());

Review Comment:
   We should rather make this method public than bringing OpenWire concept into 
commons.
   
   If it was really needed (very difficult to go around) it's ok.. but this one 
is easy to fix.
   
   I have the change here and I'm amending as you before merging it.





Issue Time Tracking
---

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

> Fix OpenWire selector with JMSMessageID
> ---
>
> Key: ARTEMIS-3916
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3916
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>




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


[jira] [Work logged] (ARTEMIS-3917) missing/incorrect getters on Configuration.java

2022-08-02 Thread ASF GitHub Bot (Jira)


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

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

Author: ASF GitHub Bot
Created on: 02/Aug/22 12:58
Start Date: 02/Aug/22 12:58
Worklog Time Spent: 10m 
  Work Description: clebertsuconic merged PR #4164:
URL: https://github.com/apache/activemq-artemis/pull/4164




Issue Time Tracking
---

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

> missing/incorrect getters on Configuration.java
> ---
>
> Key: ARTEMIS-3917
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3917
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.24.0
>Reporter: Andy Taylor
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> no method exists for getNodeManagerLockDirectory and getNetworkCheckNIC



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


[jira] [Commented] (ARTEMIS-3917) missing/incorrect getters on Configuration.java

2022-08-02 Thread ASF subversion and git services (Jira)


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

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

Commit 609343ec787208e175ff5b3b34945591726dd96e in activemq-artemis's branch 
refs/heads/main from Andy Taylor
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=609343ec78 ]

ARTEMIS-3917 Fix incorrect getters/setters on Configuration API

and added test for primitive configuration properties

https://issues.apache.org/jira/browse/ARTEMIS-3917


> missing/incorrect getters on Configuration.java
> ---
>
> Key: ARTEMIS-3917
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3917
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.24.0
>Reporter: Andy Taylor
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> no method exists for getNodeManagerLockDirectory and getNetworkCheckNIC



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


[jira] [Updated] (ARTEMIS-3917) missing/incorrect getters on Configuration.java

2022-08-02 Thread Andy Taylor (Jira)


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

Andy Taylor updated ARTEMIS-3917:
-
Issue Type: Bug  (was: Improvement)

> missing/incorrect getters on Configuration.java
> ---
>
> Key: ARTEMIS-3917
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3917
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.24.0
>Reporter: Andy Taylor
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> no method exists for getNodeManagerLockDirectory and getNetworkCheckNIC



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


[jira] [Work logged] (ARTEMIS-3917) missing/incorrect getters on Configuration.java

2022-08-02 Thread ASF GitHub Bot (Jira)


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

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

Author: ASF GitHub Bot
Created on: 02/Aug/22 10:39
Start Date: 02/Aug/22 10:39
Worklog Time Spent: 10m 
  Work Description: andytaylor opened a new pull request, #4164:
URL: https://github.com/apache/activemq-artemis/pull/4164

   and added test for primitive configuration properties
   
   https://issues.apache.org/jira/browse/ARTEMIS-3917




Issue Time Tracking
---

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

> missing/incorrect getters on Configuration.java
> ---
>
> Key: ARTEMIS-3917
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3917
> Project: ActiveMQ Artemis
>  Issue Type: Improvement
>Affects Versions: 2.24.0
>Reporter: Andy Taylor
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> no method exists for getNodeManagerLockDirectory and getNetworkCheckNIC



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


[jira] [Updated] (ARTEMIS-3917) missing/incorrect getters on Configuration.java

2022-08-02 Thread Andy Taylor (Jira)


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

Andy Taylor updated ARTEMIS-3917:
-
Description: no method exists for getNodeManagerLockDirectory and 
getNetworkCheckNIC  (was: no method exists for getNodeManagerLockDirectory and 
getNetworCheckNIC)

> missing/incorrect getters on Configuration.java
> ---
>
> Key: ARTEMIS-3917
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3917
> Project: ActiveMQ Artemis
>  Issue Type: Improvement
>Reporter: Andy Taylor
>Priority: Major
>
> no method exists for getNodeManagerLockDirectory and getNetworkCheckNIC



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


[jira] [Updated] (ARTEMIS-3917) missing/incorrect getters on Configuration.java

2022-08-02 Thread Andy Taylor (Jira)


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

Andy Taylor updated ARTEMIS-3917:
-
Affects Version/s: 2.24.0

> missing/incorrect getters on Configuration.java
> ---
>
> Key: ARTEMIS-3917
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3917
> Project: ActiveMQ Artemis
>  Issue Type: Improvement
>Affects Versions: 2.24.0
>Reporter: Andy Taylor
>Priority: Major
>
> no method exists for getNodeManagerLockDirectory and getNetworkCheckNIC



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


[jira] [Updated] (ARTEMIS-3917) missing/incorrect getters on Configuration.java

2022-08-02 Thread Andy Taylor (Jira)


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

Andy Taylor updated ARTEMIS-3917:
-
Description: no method exists for getNodeManagerLockDirectory and 
getNetworCheckNIC  (was: no method exists for 
isEnabledAsyncConnectionExecution, getNodeManagerLockDirectory
and getNetworCheckNIC)

> missing/incorrect getters on Configuration.java
> ---
>
> Key: ARTEMIS-3917
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3917
> Project: ActiveMQ Artemis
>  Issue Type: Improvement
>Reporter: Andy Taylor
>Priority: Major
>
> no method exists for getNodeManagerLockDirectory and getNetworCheckNIC



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


[jira] [Created] (ARTEMIS-3917) missing/incorrect getters on Configuration.java

2022-08-02 Thread Andy Taylor (Jira)
Andy Taylor created ARTEMIS-3917:


 Summary: missing/incorrect getters on Configuration.java
 Key: ARTEMIS-3917
 URL: https://issues.apache.org/jira/browse/ARTEMIS-3917
 Project: ActiveMQ Artemis
  Issue Type: Improvement
Reporter: Andy Taylor


no method exists for isEnabledAsyncConnectionExecution, 
getNodeManagerLockDirectory
and getNetworCheckNIC



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


[jira] [Comment Edited] (ARTEMIS-3913) MQTTReasonCodes byte loss of precision,must int type

2022-08-02 Thread gongping.zhu (Jira)


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

gongping.zhu edited comment on ARTEMIS-3913 at 8/2/22 8:44 AM:
---

yes,I want use plugin to auth client ID value,and if validation fails the 
server disconnect client and response with a specific reason code to client


was (Author: JIRAUSER293605):
yes,I want use plugin to auth client ID value,and if validation fails the 
server disconnect client and response with a specific reason code

> MQTTReasonCodes byte loss of precision,must int type
> 
>
> Key: ARTEMIS-3913
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3913
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: gongping.zhu
>Priority: Major
> Attachments: image-2022-08-02-08-23-52-965.png, 
> image-2022-08-02-08-24-39-288.png, image-2022-08-02-08-31-01-074.png, 
> image-2022-08-02-08-42-24-117.png, image-2022-08-02-08-43-39-442.png, 
> image-2022-08-02-08-45-11-459.png, image-2022-08-02-08-54-34-267.png
>
>




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


[jira] [Commented] (ARTEMIS-3913) MQTTReasonCodes byte loss of precision,must int type

2022-08-02 Thread gongping.zhu (Jira)


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

gongping.zhu commented on ARTEMIS-3913:
---

yes,I want use plugin to auth client ID value,and if validation fails the 
server disconnect client and response with a specific reason code

> MQTTReasonCodes byte loss of precision,must int type
> 
>
> Key: ARTEMIS-3913
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3913
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: gongping.zhu
>Priority: Major
> Attachments: image-2022-08-02-08-23-52-965.png, 
> image-2022-08-02-08-24-39-288.png, image-2022-08-02-08-31-01-074.png, 
> image-2022-08-02-08-42-24-117.png, image-2022-08-02-08-43-39-442.png, 
> image-2022-08-02-08-45-11-459.png, image-2022-08-02-08-54-34-267.png
>
>




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