[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435132#comment-16435132 ] ASF GitHub Bot commented on ARTEMIS-1740: - Github user franz1981 commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/2011#discussion_r180998219 --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/TextFileCertificateLoginModule.java --- @@ -71,8 +79,12 @@ protected String getUserNameForCertificates(final X509Certificate[] certs) throw if (certs == null) { throw new LoginException("Client certificates not found. Cannot authenticate."); } - - return usersByDn.get(getDistinguishedName(certs)); + String dn = getDistinguishedName(certs); + String name = usersByDn.get(dn); + if (name == null && regexpByUser != null) { + name = getUserByRegexp(dn); --- End diff -- `getUserByRegexp` is synchronized but there are uses of `usersByDn` and `regexpByUser`, like these ones, that are not: what is the reason to have `String getUserByRegexp(String dn)` synchronized? > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435124#comment-16435124 ] ASF GitHub Bot commented on ARTEMIS-1740: - Github user franz1981 commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/2011#discussion_r180996871 --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ReloadableProperties.java --- @@ -95,6 +99,21 @@ public synchronized ReloadableProperties obtained() { return invertedValueProps; } + public synchronized Map regexpPropertiesMap() { --- End diff -- You could use a [Supplier::memoize](https://google.github.io/guava/releases/19.0/api/docs/com/google/common/base/Suppliers.html#memoize(com.google.common.base.Supplier) to allow a thread-safe lazy initialization without having that method synchronized even when you just need to get `regexpProps` > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435194#comment-16435194 ] ASF GitHub Bot commented on ARTEMIS-1740: - Github user LionelCons commented on the issue: https://github.com/apache/activemq-artemis/pull/2011 The intent of `synchronized` is to protect the modification of `usersByDn`. > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435245#comment-16435245 ] ASF GitHub Bot commented on ARTEMIS-1740: - Github user franz1981 commented on the issue: https://github.com/apache/activemq-artemis/pull/2011 @LionelCons And it makes sense, but there are parts like: `String name = usersByDn.get(dn);` that are not synchronized, hence it won't be thread-safe. My advice is to use a lazy initialization using a `Suppliers::memoize` or similar construct and always use `Supplier::get` to access the variable: that would allow to have always a thread-safe access to an unmodifiable resource, lazy initialized. > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435261#comment-16435261 ] ASF GitHub Bot commented on ARTEMIS-1740: - Github user LionelCons commented on the issue: https://github.com/apache/activemq-artemis/pull/2011 @franz1981 your comment goes beyond my modifications since the existing code already uses the `get` method (in `getUserNameForCertificates` and `getUserRoles`, at least). > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435268#comment-16435268 ] ASF GitHub Bot commented on ARTEMIS-1740: - Github user franz1981 commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/2011#discussion_r181025545 --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/TextFileCertificateLoginModule.java --- @@ -71,8 +79,12 @@ protected String getUserNameForCertificates(final X509Certificate[] certs) throw if (certs == null) { throw new LoginException("Client certificates not found. Cannot authenticate."); } - - return usersByDn.get(getDistinguishedName(certs)); + String dn = getDistinguishedName(certs); + String name = usersByDn.get(dn); --- End diff -- Hence this `userByDb` not synchronized access no longer exists in the new commit? With github and multiple commits is not simple to do reviews :P > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435289#comment-16435289 ] ASF GitHub Bot commented on ARTEMIS-1740: - Github user LionelCons commented on the issue: https://github.com/apache/activemq-artemis/pull/2011 The final code can be seen [here](https://github.com/LionelCons/activemq-artemis/blob/9ead970395975a28846de4ba237eb78bc728c8fb/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/TextFileCertificateLoginModule.java). Just like in the original code, both `getUserNameForCertificates` and `getUserRoles` still use `get`. > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (ARTEMIS-1803) MessageReference should include sessionId
Christopher L. Shannon created ARTEMIS-1803: --- Summary: MessageReference should include sessionId Key: ARTEMIS-1803 URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 Project: ActiveMQ Artemis Issue Type: Improvement Affects Versions: 2.5.0 Reporter: Christopher L. Shannon Assignee: Christopher L. Shannon Right now a MessageReference will track a consumerId (in certain scenarios) but the sessionId is not included. This is a problem because consumerIds are not unique and are duplicated across sessions. In order to find a unique consumer you need the sessionId and consumerId as well. A use case for when this is important is when writing custom plugins. Some of the callbacks pass a message reference and it would be good to be able to figure out which consumer the reference belonged to such as in the messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435366#comment-16435366 ] ASF GitHub Bot commented on ARTEMIS-1803: - GitHub user cshannon opened a pull request: https://github.com/apache/activemq-artemis/pull/2012 ARTEMIS-1803 - Add sessionId to MessageReference Track the sessionId along with the consumerId in a MessageReference when appropriate in order to figure out which consumer the reference belongs to You can merge this pull request into a Git repository by running: $ git pull https://github.com/cshannon/activemq-artemis ARTEMIS-1803 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/activemq-artemis/pull/2012.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2012 commit 262cac9f0b8b581b56bda6219bd43b7922edf6c9 Author: Christopher L. Shannon (cshannon) Date: 2018-04-12T11:05:16Z ARTEMIS-1803 - Add sessionId to MessageReference Track the sessionId along with the consumerId in a MessageReference when appropriate in order to figure out which consumer the reference belongs to > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435395#comment-16435395 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user franz1981 commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 @cshannon It would be needed to update the memory footprint estimation of each message as well: rising it up it by 4 or 8 bytes wouldn't be enough probably :+1: > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435427#comment-16435427 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user cshannon commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 @franz1981 - Did you mean probably "would" be enough? The string is a UUID (which is normally 16 bytes I think) but it is owned by the ServerSessionImpl so it would just be a reference so however much memory that takes up (maybe 8 bytes to be safe?) > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435434#comment-16435434 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user franz1981 commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 @cshannon ehehe I wish to have said "would" :) The problem with the references is that the footprint of the reference depends on the JVM configuration (`-XX:+UseCompressedOops` or not) and on the alignment with the rest of the fields: the JVM tends to add padding in order to have each field size-aligned. > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435471#comment-16435471 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user cshannon commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 I updated the PR and added 8 to the estimated size in MessageRefereceImpl. > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435491#comment-16435491 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user franz1981 commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 @cshannon I've validated the original value using this tool: http://openjdk.java.net/projects/code-tools/jol/ If possible do the same or just wait that I take a look using it as well using the default configuration used for the broker. > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (ARTEMIS-1804) NPE in recent snapshot
Lionel Cons created ARTEMIS-1804: Summary: NPE in recent snapshot Key: ARTEMIS-1804 URL: https://issues.apache.org/jira/browse/ARTEMIS-1804 Project: ActiveMQ Artemis Issue Type: Bug Reporter: Lionel Cons Running some tests against {{artemis-2.6.0-20180410.175207-36}}, I noticed the broker logged several NPEs looking like: {code:java} 2018-04-12 14:19:15,097 WARN [io.netty.handler.ssl.SslHandler] [id: 0xc8c4c74d, L:/xxx:yyy ! R:/2001:1458:202:227:0:0:100:6%0:32802] flush() raised a masked exception.: java.lang.NullPointerException at io.netty.handler.ssl.SslHandler.wrapAndFlush(SslHandler.java:742) [netty-all-4.1.22.Final.jar:4.1.22.Final] at io.netty.handler.ssl.SslHandler.flush(SslHandler.java:734) [netty-all-4.1.22.Final.jar:4.1.22.Final] at io.netty.handler.ssl.SslHandler.flush(SslHandler.java:1595) [netty-all-4.1.22.Final.jar:4.1.22.Final] at io.netty.handler.ssl.SslHandler.access$600(SslHandler.java:165) [netty-all-4.1.22.Final.jar:4.1.22.Final] at io.netty.handler.ssl.SslHandler$1.run(SslHandler.java:631) [netty-all-4.1.22.Final.jar:4.1.22.Final] at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [netty-all-4.1.22.Final.jar:4.1.22.Final] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) [netty-all-4.1.22.Final.jar:4.1.22.Final] at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:309) [netty-all-4.1.22.Final.jar:4.1.22.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) [netty-all-4.1.22.Final.jar:4.1.22.Final] at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) [artemis-commons-2.6.0-SNAPSHOT.jar:2.6.0-SNAPSHOT] {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435499#comment-16435499 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user cshannon commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 @franz1981 - If you don't mind double checking with the tool again I would appreciate it since you have already validated the memory before but if you don't have time I can try and figure it out > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435520#comment-16435520 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user franz1981 commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 @cshannon Sure, np! Probably I have some minutes to do it now ;) Just a matter to download your branch and I will do it > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1804) NPE in recent snapshot
[ https://issues.apache.org/jira/browse/ARTEMIS-1804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435541#comment-16435541 ] Justin Bertram commented on ARTEMIS-1804: - Can you provide steps to reproduce? > NPE in recent snapshot > -- > > Key: ARTEMIS-1804 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1804 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Lionel Cons >Priority: Major > > Running some tests against {{artemis-2.6.0-20180410.175207-36}}, I noticed > the broker logged several NPEs looking like: > {code:java} > 2018-04-12 14:19:15,097 WARN [io.netty.handler.ssl.SslHandler] [id: > 0xc8c4c74d, L:/xxx:yyy ! R:/2001:1458:202:227:0:0:100:6%0:32802] flush() > raised a masked exception.: java.lang.NullPointerException > at io.netty.handler.ssl.SslHandler.wrapAndFlush(SslHandler.java:742) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.handler.ssl.SslHandler.flush(SslHandler.java:734) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.handler.ssl.SslHandler.flush(SslHandler.java:1595) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.handler.ssl.SslHandler.access$600(SslHandler.java:165) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.handler.ssl.SslHandler$1.run(SslHandler.java:631) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at > io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at > io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:309) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at > io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at > org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) > [artemis-commons-2.6.0-SNAPSHOT.jar:2.6.0-SNAPSHOT] > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1804) NPE in recent snapshot
[ https://issues.apache.org/jira/browse/ARTEMIS-1804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435546#comment-16435546 ] Lionel Cons commented on ARTEMIS-1804: -- Unfortunately, no. This occurred while running a private messaging test suite. > NPE in recent snapshot > -- > > Key: ARTEMIS-1804 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1804 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Lionel Cons >Priority: Major > > Running some tests against {{artemis-2.6.0-20180410.175207-36}}, I noticed > the broker logged several NPEs looking like: > {code:java} > 2018-04-12 14:19:15,097 WARN [io.netty.handler.ssl.SslHandler] [id: > 0xc8c4c74d, L:/xxx:yyy ! R:/2001:1458:202:227:0:0:100:6%0:32802] flush() > raised a masked exception.: java.lang.NullPointerException > at io.netty.handler.ssl.SslHandler.wrapAndFlush(SslHandler.java:742) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.handler.ssl.SslHandler.flush(SslHandler.java:734) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.handler.ssl.SslHandler.flush(SslHandler.java:1595) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.handler.ssl.SslHandler.access$600(SslHandler.java:165) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.handler.ssl.SslHandler$1.run(SslHandler.java:631) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at > io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at > io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:309) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at > io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at > org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) > [artemis-commons-2.6.0-SNAPSHOT.jar:2.6.0-SNAPSHOT] > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435548#comment-16435548 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user michaelandrepearce commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 Sorry to be a numpty but why this needs to be held in memory? Is it going to be used for processing the flow in broker. From an admin point even if the message is paged, if a browser or admin needs it simply get it from the message (reading out of paging) Less stuff having to hold in memory better perf. I’m a little against this if there’s no processing need for this. > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435565#comment-16435565 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user franz1981 commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 @michaelandrepearce Michael have good points on that, especially for such important classes. @cshannon I have anyway the results: ``` # Running 64-bit HotSpot VM. # Using compressed oop with 3-bit shift. # Using compressed klass with 3-bit shift. # Objects are 8 bytes aligned. # Field sizes by type: 4, 1, 1, 2, 2, 4, 4, 8, 8 [bytes] # Array element sizes: 4, 1, 1, 2, 2, 4, 4, 8, 8 [bytes] org.apache.activemq.artemis.core.server.impl.MessageReferenceImpl object internals: OFFSET SIZE TYPE DESCRIPTION VALUE 012 (object header) N/A 12 4 int Node.iterCount N/A 16 4 org.apache.activemq.artemis.utils.collections.LinkedListImpl.Node Node.next N/A 20 4 org.apache.activemq.artemis.utils.collections.LinkedListImpl.Node Node.prev N/A 24 8 long MessageReferenceImpl.scheduledDeliveryTime N/A 32 8 long MessageReferenceImpl.consumerID N/A 40 4 int MessageReferenceImpl.deliveryCount N/A 44 4 int MessageReferenceImpl.persistedCount N/A 48 1 boolean MessageReferenceImpl.hasConsumerID N/A 49 1 boolean MessageReferenceImpl.alreadyAckedN/A 50 2 (alignment/padding gap) 52 4 org.apache.activemq.artemis.api.core.Message MessageReferenceImpl.message N/A 56 4 org.apache.activemq.artemis.core.server.Queue MessageReferenceImpl.queue N/A 60 4 java.lang.String MessageReferenceImpl.sessionId N/A 64 4 java.lang.Object MessageReferenceImpl.protocolDataN/A 68 4 (loss due to the next object alignment) Instance size: 72 bytes Space losses: 2 bytes internal + 4 bytes external = 6 bytes total * org.apache.activemq.artemis.core.paging.cursor.PagedReferenceImpl object internals: OFFSET SIZE TYPE DESCRIPTION VALUE 012 (object header) N/A 12 4 int Node.iterCountN/A 16 4 org.apache.activemq.artemis.utils.collections.LinkedListImpl.Node Node.next N/A 20 4 org.apache.activemq.artemis.utils.collections.LinkedListImpl.Node Node.prev N/A 24 8 long PagedReferenceImpl.deliveryTime N/A 32 8 long PagedReferenceImpl.consumerID N/A 40 8 long PagedReferenceImpl.transactionID N/A 48 8 long PagedReferenceImpl.messageID N/A 56 8 long PagedReferenceImpl.messageSizeN/A 64 4 int PagedReferenceImpl.persistedCount N/A 68 4 in
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435569#comment-16435569 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user cshannon commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 It's not attached to the message. The reference has the information for which consumer is attached to it. The consumer id is not unique so you need to have the session Id as well otherwise there is no way to find out which consumer the reference belongs to so this has to be in memory. I really don't think it's going to be a big deal to add a reference id. > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435570#comment-16435570 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user cshannon commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 Furthermore there is more to a broker than just processing. Monitoring and metrics are very important to business flows and trying to save a few bytes of memory is not worth it if you sacrifice basic things such as being able to do proper logging and troubleshooting. > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435589#comment-16435589 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user cshannon commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 For example, it's a common use case to fire notifications or logging when a message is acknowledged. I have a requirement to do this for my organization and I need to quickly track the specific consumer that acked the message from inside the plugin. Having the sessionId as part of the reference is the only way to do this. > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435591#comment-16435591 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user cshannon commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 @franz1981 - So what size would you recommend? Seems like maybe 8 is too much to add to the estimation based on the output. > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435596#comment-16435596 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user michaelandrepearce commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 Should that then not be logged by the consumer code referencing the message if needed? As the consumer anyhow will be causing the ack. > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435620#comment-16435620 ] ASF GitHub Bot commented on ARTEMIS-1740: - Github user jbertram commented on the issue: https://github.com/apache/activemq-artemis/pull/2011 Thanks for the changes, @LionelCons. Can you squash your commits? > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435626#comment-16435626 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user cshannon commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 @michaelandrepearce - because 1) there can be more than just that use case for having sessionId part of the reference in the future and 2) the acknowledge code is not part of the consumer and is handled later by the QueueImpl...see the acknowledge method inside QueueImpl..it just gets the reference and does the acking and doesn't know the consumer by that point because the ServerConsumer calls ack on the ref but doesn't pass itself to it...there would have to be a good amount of refactoring to change this along with changes to public interfaces > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435643#comment-16435643 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user michaelandrepearce commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 As noted my biggest concern is that message refs need to be as light as humanly possible as they’re all in memory and affects greatly the scaling. I would personally prefer the refactor if needed, than take this hit. Especially as this is only needed by someone wanting to use this in a plugin. Which means everyone else has to suffer > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435654#comment-16435654 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user cshannon commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 I understand wanting to keep memory low but there's a point where you take things too far. At some point usability and correctness is more important. Having just a consumerId is just not correct, end of story. It is not a unique value and will be duplicated. The client library is responsible for creating that consumerId per session so there's no way to go back and make the consumerId unique (can't change old client libraries). I wish there were, that would solve this problem. I do not agree that refactoring is the best approach. At the end of the day if we can't add a reference to a String I think we are taking trying to limit memory usage too far. > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435657#comment-16435657 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user michaelandrepearce commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 I disagree it’s a 4% overhead at best and 10% extra over head for worst. That’s quite a kick > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435669#comment-16435669 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user franz1981 commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 @cshannon Summarized: ``` org.apache.activemq.artemis.core.server.impl.MessageReferenceImpl: Instance size: 72 bytes Space losses: 2 bytes internal + 4 bytes external = 6 bytes total org.apache.activemq.artemis.core.paging.cursor.PagedReferenceImpl: Instance size: 104 bytes Space losses: 1 bytes internal + 4 bytes external = 5 bytes total org.apache.activemq.artemis.core.server.impl.LastValueQueue$HolderReference: Instance size: 40 bytes Space losses: 3 bytes internal + 0 bytes external = 3 bytes total ``` `Instance size` is the value you're searching for: I have attached the `Space losses` as well, because it is related to what @michaelandrepearce is saying: just adding that mere 4 bytes reference (with heap < 32 Gb the JVM uses compressed oops by default) has added 4 bytes (external) of padding ie a total of 8 bytes of more space used. TBH that's a difficult choice: we have done recently many changes to make every protocol much GC "gentle" to allow scaling more easily, but @cshannon is right that there are monitoring/telemetry reasons very important to be achieved as well. You both have very good points :O > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1804) NPE in recent snapshot
[ https://issues.apache.org/jira/browse/ARTEMIS-1804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435670#comment-16435670 ] Justin Bertram commented on ARTEMIS-1804: - Is it not possible to describe the issue simply in messaging terms (e.g. started broker, STOMP producer sent message to "/queue/foo" using SSL, etc.) without revealing any private information? > NPE in recent snapshot > -- > > Key: ARTEMIS-1804 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1804 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Lionel Cons >Priority: Major > > Running some tests against {{artemis-2.6.0-20180410.175207-36}}, I noticed > the broker logged several NPEs looking like: > {code:java} > 2018-04-12 14:19:15,097 WARN [io.netty.handler.ssl.SslHandler] [id: > 0xc8c4c74d, L:/xxx:yyy ! R:/2001:1458:202:227:0:0:100:6%0:32802] flush() > raised a masked exception.: java.lang.NullPointerException > at io.netty.handler.ssl.SslHandler.wrapAndFlush(SslHandler.java:742) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.handler.ssl.SslHandler.flush(SslHandler.java:734) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.handler.ssl.SslHandler.flush(SslHandler.java:1595) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.handler.ssl.SslHandler.access$600(SslHandler.java:165) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.handler.ssl.SslHandler$1.run(SslHandler.java:631) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at > io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at > io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:309) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at > io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) > [netty-all-4.1.22.Final.jar:4.1.22.Final] > at > org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) > [artemis-commons-2.6.0-SNAPSHOT.jar:2.6.0-SNAPSHOT] > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435687#comment-16435687 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user michaelandrepearce commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 My point is whilst it will require not quite a quick win, it’s not impossible to avoid this, and refactor to get this is probably a good thing. I realise it’s not a quick win as this. But nor is all the scaling and perf Work we have been doing. > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) MessageReference should include sessionId
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435705#comment-16435705 ] Christopher L. Shannon commented on ARTEMIS-1803: - I will test out adding the ServerConsumer (if exists) as an argument to the acknowledge method (and then the plugin method). It's not so much that changing or refactoring is hard it's the fact that it would change public methods but if that's not a big deal then I will see if it works. > MessageReference should include sessionId > - > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435796#comment-16435796 ] ASF GitHub Bot commented on ARTEMIS-1740: - Github user LionelCons commented on the issue: https://github.com/apache/activemq-artemis/pull/2011 @jbertram can you squash the commits when merging? > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (ARTEMIS-1803) Pass ServerConsumer to messageExpired and messageAcknowledged plugin callbacks
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christopher L. Shannon updated ARTEMIS-1803: Summary: Pass ServerConsumer to messageExpired and messageAcknowledged plugin callbacks (was: MessageReference should include sessionId) > Pass ServerConsumer to messageExpired and messageAcknowledged plugin callbacks > -- > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. > A use case for when this is important is when writing custom plugins. Some > of the callbacks pass a message reference and it would be good to be able to > figure out which consumer the reference belonged to such as in the > messageAcknowledged callback. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (ARTEMIS-1803) Pass ServerConsumer to messageExpired and messageAcknowledged plugin callbacks
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christopher L. Shannon updated ARTEMIS-1803: Description: Right now a MessageReference will track a consumerId (in certain scenarios) but the sessionId is not included. This is a problem because consumerIds are not unique and are duplicated across sessions. In order to find a unique consumer you need the sessionId and consumerId as well. This is a problem for plugins implementing messageExpired and messageAcknowledged as they can't get the exact consumer based on just the consumerId. To solve this the ServerConsumer object responsible for acknowledging the message or expiring the message should be passed to those callback methods. If consumer doesn't apply (such as when the broker expires internally or internally moves messages and acks) then the consumer object will be null. was: Right now a MessageReference will track a consumerId (in certain scenarios) but the sessionId is not included. This is a problem because consumerIds are not unique and are duplicated across sessions. In order to find a unique consumer you need the sessionId and consumerId as well. A use case for when this is important is when writing custom plugins. Some of the callbacks pass a message reference and it would be good to be able to figure out which consumer the reference belonged to such as in the messageAcknowledged callback. > Pass ServerConsumer to messageExpired and messageAcknowledged plugin callbacks > -- > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. This is a problem > for plugins implementing messageExpired and messageAcknowledged as they can't > get the exact consumer based on just the consumerId. > To solve this the ServerConsumer object responsible for acknowledging the > message or expiring the message should be passed to those callback methods. > If consumer doesn't apply (such as when the broker expires internally or > internally moves messages and acks) then the consumer object will be null. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) Pass ServerConsumer to messageExpired and messageAcknowledged plugin callbacks
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435911#comment-16435911 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user cshannon commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 @franz1981 and @michaelandrepearce - I updated the patch to pass a reference to the ServerConsumer (when it applies) for both the expired and acked callbacks and dropped the extra reference to the serverId in the MessageReference classlet me know what you think > Pass ServerConsumer to messageExpired and messageAcknowledged plugin callbacks > -- > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. This is a problem > for plugins implementing messageExpired and messageAcknowledged as they can't > get the exact consumer based on just the consumerId. > To solve this the ServerConsumer object responsible for acknowledging the > message or expiring the message should be passed to those callback methods. > If consumer doesn't apply (such as when the broker expires internally or > internally moves messages and acks) then the consumer object will be null. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435921#comment-16435921 ] ASF GitHub Bot commented on ARTEMIS-1740: - Github user clebertsuconic commented on the issue: https://github.com/apache/activemq-artemis/pull/2011 @LionelCons I can.. if this is ready to be merged. > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435927#comment-16435927 ] ASF GitHub Bot commented on ARTEMIS-1740: - Github user asfgit closed the pull request at: https://github.com/apache/activemq-artemis/pull/2011 > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435926#comment-16435926 ] ASF GitHub Bot commented on ARTEMIS-1740: - Github user clebertsuconic commented on the issue: https://github.com/apache/activemq-artemis/pull/2011 done > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1740) Add support for regex based certificate authentication
[ https://issues.apache.org/jira/browse/ARTEMIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435925#comment-16435925 ] ASF subversion and git services commented on ARTEMIS-1740: -- Commit 1e81361a88a2dd333d7f5c7f926dde515e5b7ac5 in activemq-artemis's branch refs/heads/master from [~lionel.cons] [ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=1e81361 ] ARTEMIS-1740: Add support for regex based certificate authentication > Add support for regex based certificate authentication > -- > > Key: ARTEMIS-1740 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1740 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Lionel Cons >Priority: Major > > The current certificate authentication module > ({{TextFileCertificateLoginModule}}) uses a file mapping user names to DNs. > In some cases, the list of known DNs can be large and dynamic. This is the > case for instance when using host certificates. > Host certificates could be very dynamic (when new virtual machines get > created) while keeping a fixed structure such as {{CN=hostxyz.acme.org, > OU=computers, DC=acme, DC=org}}. It is impractical to generate all the > possible DNs and feed this to Artemis. > It would be very useful to have regular expression based certificate > authentication. With the example above, we could have a single line: > {quote} > acme.computers=/^CN=\w+\.acme\.org, OU=computers, DC=acme, DC=org$/ > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1803) Pass ServerConsumer to messageExpired and messageAcknowledged plugin callbacks
[ https://issues.apache.org/jira/browse/ARTEMIS-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16436323#comment-16436323 ] ASF GitHub Bot commented on ARTEMIS-1803: - Github user michaelandrepearce commented on the issue: https://github.com/apache/activemq-artemis/pull/2012 I personally prefer this. > Pass ServerConsumer to messageExpired and messageAcknowledged plugin callbacks > -- > > Key: ARTEMIS-1803 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1803 > Project: ActiveMQ Artemis > Issue Type: Improvement >Affects Versions: 2.5.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Minor > > Right now a MessageReference will track a consumerId (in certain scenarios) > but the sessionId is not included. This is a problem because consumerIds are > not unique and are duplicated across sessions. In order to find a unique > consumer you need the sessionId and consumerId as well. This is a problem > for plugins implementing messageExpired and messageAcknowledged as they can't > get the exact consumer based on just the consumerId. > To solve this the ServerConsumer object responsible for acknowledging the > message or expiring the message should be passed to those callback methods. > If consumer doesn't apply (such as when the broker expires internally or > internally moves messages and acks) then the consumer object will be null. -- This message was sent by Atlassian JIRA (v7.6.3#76005)