[jira] [Commented] (ARTEMIS-1921) Setting client ID on core JMS should be reflected in broker RemotingConnection
[ https://issues.apache.org/jira/browse/ARTEMIS-1921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837970#comment-17837970 ] Justin Bertram commented on ARTEMIS-1921: - The client ID won't be available to the security manager, but it can be available on the internal {{RemotingConnection}} which will be visible via JMX. This is already the case for AMQP and OpenWire. The fix for this issue will do this for Core. > Setting client ID on core JMS should be reflected in broker RemotingConnection > -- > > Key: ARTEMIS-1921 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1921 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: Broker >Affects Versions: 2.6.1 >Reporter: Johan Stenberg >Priority: Major > Attachments: Artemis1921_CoreJmsClient_SetClientId_Test.java > > Time Spent: 10m > Remaining Estimate: 0h > > As opposite to Qpid JMS Client over AMPQ1.0 or FuseSource StompJMS client > over STOMP, a clientID set on the JMS ConnectionFactory or the Connection in > the Artemis JMS Client is not available on the broker via > RemotingConnection#getClientID(). -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (ARTEMIS-4716) Improve Jakarta Messaging / JMS documentation
[ https://issues.apache.org/jira/browse/ARTEMIS-4716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837969#comment-17837969 ] Justin Bertram commented on ARTEMIS-4716: - bq. I find it isn't a common operation, however, to want to incorporate a third party tool in a way that integrates with the Jakarta EE ecosystem. Generally speaking, integrating 3rd party implementations may not be common, but is it fairly common with messaging. It's quite common to integrate a 3rd party JMS implementation with an EE application server (e.g. MDBs consuming & sending messages in an XA transaction). bq. Luckily, Apache ActiveMQ Artemis has such integration, through the "artemis-jakarta-client" package. To be clear, there is nothing EE-specific about the {{artemis-jakarta-client}} package. In fact, I would say its main use-case is in a Java SE context. bq. I would like to take advantage of Artemis' integration with Jakarta and use dependency injection via CDI instead, as that seems more robust, and guessing that this is the recommended usage. Using Jakarta classes really has nothing to do with CDI. Those two things are mutually exclusive. Furthermore, I'm not sure if using CDI vs. manual JNDI lookups is more robust or necessarily recommended more highly. I see CDI mainly as a convenience for developers and not much more. I don't do a lot of EE programming these days so maybe there's more to it that I'm not familiar with. bq. What I would love to see, then, is an example of "artemis-jakarta-client" being used in whichever way was intended by the authors, in a working Jakarta EE project, for whichever Jakarta EE implementation. As noted previously the {{artemis-jakarta-client}} has no specific ties to EE use-cases. It's usable in SE and EE environments alike. bq. Has "artemis-jakarta-client" ever been used in a Jakarta EE project, either an example or a real-world one? Yes. ActiveMQ Artemis is the JMS implementation shipped with [WildFly|https://www.wildfly.org/]. bq. Regardless, this is precisely the type of step that I expect the documentation to tell me whether I need or not. That documentation should come from whatever application server you're using based on your specific use-case. If all you're doing is injecting an ActiveMQ Artemis {{ConnectionFactory}} then you'll need to inform the application server about how to actually instantiate that object. You may need the ActiveMQ Artemis JCA RA for that or you may not. Different application servers have different requirements. This is beyond the scope of the ActiveMQ Artemis documentation. > Improve Jakarta Messaging / JMS documentation > - > > Key: ARTEMIS-4716 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4716 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: JMS >Affects Versions: 2.33.0 >Reporter: Daniel Martin >Priority: Minor > > I'm struggling to understand [these > instructions|https://activemq.apache.org/components/artemis/documentation/latest/using-jms.html] > to use Artemis in the context of Jakarta Messaging which perhaps could be > updated / simplified / improved. > At the moment, I'm depending on {{artemis-jakarta-client}} and manually > instantiating {{ActiveMQConnectionFactory}}. While investigating a memory > leak that may come from my usage of ActiveMQ, I wanted to simplify this part > and rely on dependency injection instead. However, I don't begin to > understand how to do such thing. > My expectation was to be able to use the {{@Inject}} annotation to get a > reference to a {{ConnectionFactory}}, {{JMSContext}}, or similar and to be > able to provide configuration such as broker address and credentials > _somewhere_ as to end up with a reference to a {{Connection}} which is > ultimately what I need. Is this possible? What's the recommended way? Is > there any (working) reference examples? -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-1769) Return JMS Session's ClientID via JMX
[ https://issues.apache.org/jira/browse/ARTEMIS-1769?focusedWorklogId=915016=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-915016 ] ASF GitHub Bot logged work on ARTEMIS-1769: --- Author: ASF GitHub Bot Created on: 17/Apr/24 05:24 Start Date: 17/Apr/24 05:24 Worklog Time Spent: 10m Work Description: jbertram opened a new pull request, #4892: URL: https://github.com/apache/activemq-artemis/pull/4892 (no comment) Issue Time Tracking --- Worklog Id: (was: 915016) Remaining Estimate: 0h Time Spent: 10m > Return JMS Session's ClientID via JMX > - > > Key: ARTEMIS-1769 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1769 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: Broker >Affects Versions: 2.5.0 >Reporter: Maxim Kalina >Assignee: Justin Bertram >Priority: Minor > Labels: patch > Attachments: return_jms_session's_clientID_via_JMX_if_exists.patch > > Time Spent: 10m > Remaining Estimate: 0h > > As discussed in the mailing list, currently there is no possibility to get > the JMS session's *clientID* via JMX. > > I've attached the patch that extends the *ActiveMQServerControlImpl* and > *SessionView* classes to return the *clientID* if available. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4729) Upgrade slf4j version to 2.0.12
[ https://issues.apache.org/jira/browse/ARTEMIS-4729?focusedWorklogId=915010=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-915010 ] ASF GitHub Bot logged work on ARTEMIS-4729: --- Author: ASF GitHub Bot Created on: 17/Apr/24 04:04 Start Date: 17/Apr/24 04:04 Worklog Time Spent: 10m Work Description: brusdev opened a new pull request, #4891: URL: https://github.com/apache/activemq-artemis/pull/4891 (no comment) Issue Time Tracking --- Worklog Id: (was: 915010) Remaining Estimate: 0h Time Spent: 10m > Upgrade slf4j version to 2.0.12 > --- > > Key: ARTEMIS-4729 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4729 > Project: ActiveMQ Artemis > Issue Type: Dependency upgrade >Reporter: Domenico Francesco Bruscino >Assignee: Domenico Francesco Bruscino >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (ARTEMIS-4729) Upgrade slf4j version to 2.0.12
Domenico Francesco Bruscino created ARTEMIS-4729: Summary: Upgrade slf4j version to 2.0.12 Key: ARTEMIS-4729 URL: https://issues.apache.org/jira/browse/ARTEMIS-4729 Project: ActiveMQ Artemis Issue Type: Dependency upgrade Reporter: Domenico Francesco Bruscino Assignee: Domenico Francesco Bruscino -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4728) Upgrade jgroups version to 5.3.4.Final
[ https://issues.apache.org/jira/browse/ARTEMIS-4728?focusedWorklogId=915009=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-915009 ] ASF GitHub Bot logged work on ARTEMIS-4728: --- Author: ASF GitHub Bot Created on: 17/Apr/24 03:57 Start Date: 17/Apr/24 03:57 Worklog Time Spent: 10m Work Description: brusdev opened a new pull request, #4890: URL: https://github.com/apache/activemq-artemis/pull/4890 (no comment) Issue Time Tracking --- Worklog Id: (was: 915009) Remaining Estimate: 0h Time Spent: 10m > Upgrade jgroups version to 5.3.4.Final > -- > > Key: ARTEMIS-4728 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4728 > Project: ActiveMQ Artemis > Issue Type: Dependency upgrade >Reporter: Domenico Francesco Bruscino >Assignee: Domenico Francesco Bruscino >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (ARTEMIS-4728) Upgrade jgroups version to 5.3.4.Final
Domenico Francesco Bruscino created ARTEMIS-4728: Summary: Upgrade jgroups version to 5.3.4.Final Key: ARTEMIS-4728 URL: https://issues.apache.org/jira/browse/ARTEMIS-4728 Project: ActiveMQ Artemis Issue Type: Dependency upgrade Reporter: Domenico Francesco Bruscino Assignee: Domenico Francesco Bruscino -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837926#comment-17837926 ] ASF subversion and git services commented on ARTEMIS-4725: -- Commit 8880ae92d9e3c3160bcc66e0028d29972db326ba in activemq-artemis's branch refs/heads/main from Clebert Suconic [ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=8880ae92d9 ] ARTEMIS-4725 Fixing intermittent failure on test > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 3h 50m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (ARTEMIS-1769) Return JMS Session's ClientID via JMX
[ https://issues.apache.org/jira/browse/ARTEMIS-1769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837856#comment-17837856 ] Justin Bertram commented on ARTEMIS-1769: - Thanks to ARTEMIS-1947 the session's meta-data is now returned and thanks to ARTEMIS-1921 the JMS client ID is set on the core {{RemotingConnection}}. Therefore, fix here just needs to return the client ID for clarity's sake. > Return JMS Session's ClientID via JMX > - > > Key: ARTEMIS-1769 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1769 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: Broker >Affects Versions: 2.5.0 >Reporter: Maxim Kalina >Assignee: Justin Bertram >Priority: Minor > Labels: patch > Attachments: return_jms_session's_clientID_via_JMX_if_exists.patch > > > As discussed in the mailing list, currently there is no possibility to get > the JMS session's *clientID* via JMX. > > I've attached the patch that extends the *ActiveMQServerControlImpl* and > *SessionView* classes to return the *clientID* if available. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837837#comment-17837837 ] ASF subversion and git services commented on ARTEMIS-4725: -- Commit 329d963717d5e73e22d181e251fae20fc5c73809 in activemq-artemis's branch refs/heads/main from Timothy Bish [ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=329d963717 ] ARTEMIS-4725 Fix AMQP outgoing encoding if da encoded before header Fix the AMQP message scanning to account for the header not being at the front of the buffer which also accounts for odd case of broker storing message with delivery annotations ahead of the header. > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 3h 50m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837838#comment-17837838 ] ASF subversion and git services commented on ARTEMIS-4725: -- Commit eb7b0b09467c0395dbb5d628ccb93734feae1f5e in activemq-artemis's branch refs/heads/main from Clebert Suconic [ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=eb7b0b0946 ] ARTEMIS-4725 Mirroring tests using multiple versions > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 3h 50m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914974=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914974 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 18:53 Start Date: 16/Apr/24 18:53 Worklog Time Spent: 10m Work Description: clebertsuconic merged PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888 Issue Time Tracking --- Worklog Id: (was: 914974) Time Spent: 3h 50m (was: 3h 40m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 3h 50m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914969=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914969 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 17:56 Start Date: 16/Apr/24 17:56 Worklog Time Spent: 10m Work Description: tabish121 commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567752253 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: There should be no need for a client to test this, just the test decodes the message based on what you said is the issue, without knowing more I can't write a better test but that doesn't mean it isn't testable without a client. Issue Time Tracking --- Worklog Id: (was: 914969) Time Spent: 3h 40m (was: 3.5h) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 3h 40m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914959=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914959 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 17:32 Start Date: 16/Apr/24 17:32 Worklog Time Spent: 10m Work Description: clebertsuconic commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567726290 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: @tabish121 the test you wrote is validating if the parsing would work correctly.. however with your fix the client is not being to actually receive the message. You would need to write a test with the wrong encoding and have an actual client receiving the message. Issue Time Tracking --- Worklog Id: (was: 914959) Time Spent: 3.5h (was: 3h 20m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 3.5h > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914958=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914958 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 17:27 Start Date: 16/Apr/24 17:27 Worklog Time Spent: 10m Work Description: clebertsuconic commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567720798 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: @tabish121 my fix is only applied when the header is switched with the delivery annotation, an aberration that shouldn't actually ever happen, but it did. Issue Time Tracking --- Worklog Id: (was: 914958) Time Spent: 3h 20m (was: 3h 10m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 3h 20m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914957=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914957 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 17:26 Start Date: 16/Apr/24 17:26 Worklog Time Spent: 10m Work Description: clebertsuconic commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567719937 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: The test is creating the wrong encoding in 2.33 and consuming it in main using real bits from 2.33, just like the customer case. I will work on the AMQPMessageTest. Issue Time Tracking --- Worklog Id: (was: 914957) Time Spent: 3h 10m (was: 3h) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 3h 10m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914955=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914955 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 17:24 Start Date: 16/Apr/24 17:24 Worklog Time Spent: 10m Work Description: tabish121 commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567717178 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: Then it would be good to create a test case in the AMQPMessageTest that is reproducing the formatting and verifying a fix, you fix doesn't look correct to me but without knowing what you are actually reproducing its hard to judge Issue Time Tracking --- Worklog Id: (was: 914955) Time Spent: 2h 50m (was: 2h 40m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 2h 50m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914956=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914956 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 17:24 Start Date: 16/Apr/24 17:24 Worklog Time Spent: 10m Work Description: tabish121 commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567717178 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: Then it would be good to create a test case in the AMQPMessageTest that is reproducing the formatting and verifying a fix, your fix doesn't look correct to me but without knowing what you are actually reproducing its hard to judge Issue Time Tracking --- Worklog Id: (was: 914956) Time Spent: 3h (was: 2h 50m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 3h > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914953=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914953 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 17:22 Start Date: 16/Apr/24 17:22 Worklog Time Spent: 10m Work Description: clebertsuconic commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567714521 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: and the messages are not consumed properly with your fix.. I just tested it. Issue Time Tracking --- Worklog Id: (was: 914953) Time Spent: 2h 40m (was: 2.5h) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 2h 40m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914952=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914952 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 17:21 Start Date: 16/Apr/24 17:21 Worklog Time Spent: 10m Work Description: clebertsuconic commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567713737 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: @tabish121 the compatibility tests is creating the situation with 2.33.. and consuming the message in HEADER/main basically creating the real condition where it happened. Issue Time Tracking --- Worklog Id: (was: 914952) Time Spent: 2.5h (was: 2h 20m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 2.5h > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914951=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914951 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 17:17 Start Date: 16/Apr/24 17:17 Worklog Time Spent: 10m Work Description: tabish121 commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567709683 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: The compatibly tests are fairly incomprehensible so I can't really tell what it is doing or if it is or isn't reproducing anything. I added a link to commit that tests the basic handling of message encoded with delivery annotations ahead of headers and showed that the one line change to fix the encoded header size sorts that scenario. Issue Time Tracking --- Worklog Id: (was: 914951) Time Spent: 2h 20m (was: 2h 10m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 2h 20m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914950=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914950 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 17:15 Start Date: 16/Apr/24 17:15 Worklog Time Spent: 10m Work Description: clebertsuconic commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567706638 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: and this is the reason I expanded the compatibility-tests.. if you generated the messages in 2.33, stopped both brokers with accumulated messages, the clients won't know how to parse them because they are wrongly encoded. Issue Time Tracking --- Worklog Id: (was: 914950) Time Spent: 2h 10m (was: 2h) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 2h 10m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914949=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914949 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 17:14 Start Date: 16/Apr/24 17:14 Worklog Time Spent: 10m Work Description: clebertsuconic commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567705435 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: @tabish121 this is working around wrongly encoded messages from the older version. in case an user has messages wrongly encoded, they could just switch to the newer version that would know how to deal with it. What is the alternative? Issue Time Tracking --- Worklog Id: (was: 914949) Time Spent: 2h (was: 1h 50m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 2h > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914940=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914940 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 16:31 Start Date: 16/Apr/24 16:31 Worklog Time Spent: 10m Work Description: tabish121 commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567656042 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: I created a couple simple tests for this and just the one line fix [here](https://github.com/tabish121/activemq-artemis/commit/7f19cfc965d06c08217967fcf5bfb6d28d5058da) and that seems to be all that's needed: Issue Time Tracking --- Worklog Id: (was: 914940) Time Spent: 1h 50m (was: 1h 40m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 1h 50m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914935=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914935 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 16:06 Start Date: 16/Apr/24 16:06 Worklog Time Spent: 10m Work Description: tabish121 commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567621714 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + Review Comment: I'm not convinced you need to change this after having adjusted the encodedHeraderSize value to account for it not being at the start of the buffer. I must say that it feels a bit odd to be allowing wrongly encoded AMQP message format zero messages through in the first place, we probably should have been catching that and rejecting the messages really. Issue Time Tracking --- Worklog Id: (was: 914935) Time Spent: 1h 40m (was: 1.5h) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 1h 40m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914926=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914926 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 15:41 Start Date: 16/Apr/24 15:41 Worklog Time Spent: 10m Work Description: clebertsuconic commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567586092 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + + if (headerPosition > deliveryAnnotationsPosition && headerPosition != VALUE_NOT_PRESENT && deliveryAnnotationsPosition != VALUE_NOT_PRESENT) { + // this is for a case where delivery annotations was swiched wrongly in a previous version + duplicate.position(deliveryAnnotationsPosition + encodedDeliveryAnnotationsSize); Review Comment: in regard to this calculation, the headerPosition was calculated wrongly when the header was switched I'm fixing it. Issue Time Tracking --- Worklog Id: (was: 914926) Time Spent: 1.5h (was: 1h 20m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 1.5h > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914925=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914925 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 15:41 Start Date: 16/Apr/24 15:41 Worklog Time Spent: 10m Work Description: clebertsuconic commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567585396 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + + if (headerPosition > deliveryAnnotationsPosition && headerPosition != VALUE_NOT_PRESENT && deliveryAnnotationsPosition != VALUE_NOT_PRESENT) { + // this is for a case where delivery annotations was swiched wrongly in a previous version + duplicate.position(deliveryAnnotationsPosition + encodedDeliveryAnnotationsSize); Review Comment: @gemmellr the issue manifested by stopping all brokers with messages accumulated. and this is what the test is doing. It's also mixing versions so that they can be swapped. I will add more tests but I will keep this test I wrote. Issue Time Tracking --- Worklog Id: (was: 914925) Time Spent: 1h 20m (was: 1h 10m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 1h 20m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (ARTEMIS-4727) Fix STOMP durable sub doc and property precedence
[ https://issues.apache.org/jira/browse/ARTEMIS-4727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Justin Bertram updated ARTEMIS-4727: Description: The code and the documentation are incorrect regarding the precedence of the STOMP frame headers used to identify the name of a durable subscription. > Fix STOMP durable sub doc and property precedence > - > > Key: ARTEMIS-4727 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4727 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Justin Bertram >Assignee: Justin Bertram >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > The code and the documentation are incorrect regarding the precedence of the > STOMP frame headers used to identify the name of a durable subscription. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4727) Fix STOMP durable sub doc and property precedence
[ https://issues.apache.org/jira/browse/ARTEMIS-4727?focusedWorklogId=914913=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914913 ] ASF GitHub Bot logged work on ARTEMIS-4727: --- Author: ASF GitHub Bot Created on: 16/Apr/24 14:45 Start Date: 16/Apr/24 14:45 Worklog Time Spent: 10m Work Description: jbertram opened a new pull request, #4889: URL: https://github.com/apache/activemq-artemis/pull/4889 (no comment) Issue Time Tracking --- Worklog Id: (was: 914913) Remaining Estimate: 0h Time Spent: 10m > Fix STOMP durable sub doc and property precedence > - > > Key: ARTEMIS-4727 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4727 > 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-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914908=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914908 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 14:36 Start Date: 16/Apr/24 14:36 Worklog Time Spent: 10m Work Description: gemmellr commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567477400 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + + if (headerPosition > deliveryAnnotationsPosition && headerPosition != VALUE_NOT_PRESENT && deliveryAnnotationsPosition != VALUE_NOT_PRESENT) { + // this is for a case where delivery annotations was swiched wrongly in a previous version + duplicate.position(deliveryAnnotationsPosition + encodedDeliveryAnnotationsSize); Review Comment: I dont understand the issue to the extent you do, but if from the comment in the code you are saying the sections were reversed, then the code as-is simply does not seem correct. If they were something more than reversed, its not clear to me it could be handled. (Its not clear to me that it should be trying at all, its basically a corrupted message). The tests also passed before, so that may just mean you dont have a focused enough test yet. I probably wouldnt be using Qpid JMS to ultimately check this either, it should be verifying/decoding the payload more closely. Arguably this should be more easily unit testable given its in the message object. Issue Time Tracking --- Worklog Id: (was: 914908) Time Spent: 1h 10m (was: 1h) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 1h 10m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (ARTEMIS-4727) Fix STOMP durable sub doc and property precedence
Justin Bertram created ARTEMIS-4727: --- Summary: Fix STOMP durable sub doc and property precedence Key: ARTEMIS-4727 URL: https://issues.apache.org/jira/browse/ARTEMIS-4727 Project: ActiveMQ Artemis Issue Type: Bug Reporter: Justin Bertram Assignee: Justin Bertram -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914868=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914868 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 13:25 Start Date: 16/Apr/24 13:25 Worklog Time Spent: 10m Work Description: clebertsuconic commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567358918 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + + if (headerPosition > deliveryAnnotationsPosition && headerPosition != VALUE_NOT_PRESENT && deliveryAnnotationsPosition != VALUE_NOT_PRESENT) { + // this is for a case where delivery annotations was swiched wrongly in a previous version + duplicate.position(deliveryAnnotationsPosition + encodedDeliveryAnnotationsSize); Review Comment: basically the test works with what I have now, and it failed with setting the position after the header. Issue Time Tracking --- Worklog Id: (was: 914868) Time Spent: 1h (was: 50m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 1h > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914867=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914867 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 13:25 Start Date: 16/Apr/24 13:25 Worklog Time Spent: 10m Work Description: clebertsuconic commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567358070 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + + if (headerPosition > deliveryAnnotationsPosition && headerPosition != VALUE_NOT_PRESENT && deliveryAnnotationsPosition != VALUE_NOT_PRESENT) { + // this is for a case where delivery annotations was swiched wrongly in a previous version + duplicate.position(deliveryAnnotationsPosition + encodedDeliveryAnnotationsSize); Review Comment: I tried using headerPosition+headerSize, and didn't work... I ended up thinking it was correct, but now that you raised this I don't know either.. :) let me review this.. I might need your help Issue Time Tracking --- Worklog Id: (was: 914867) Time Spent: 50m (was: 40m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 50m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (ARTEMIS-4625) Upgrade CheckStyle to 10.15.0
[ https://issues.apache.org/jira/browse/ARTEMIS-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837650#comment-17837650 ] ASF subversion and git services commented on ARTEMIS-4625: -- Commit 7072eb187ac4dea1a68414823e7b883a38ee319a in activemq-artemis's branch refs/heads/main from Justin Bertram [ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=7072eb187a ] ARTEMIS-4625 upgrade CheckStyle to 10.15.0 > Upgrade CheckStyle to 10.15.0 > - > > Key: ARTEMIS-4625 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4625 > Project: ActiveMQ Artemis > Issue Type: Dependency upgrade >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] [Resolved] (ARTEMIS-4625) Upgrade CheckStyle to 10.15.0
[ https://issues.apache.org/jira/browse/ARTEMIS-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robbie Gemmell resolved ARTEMIS-4625. - Fix Version/s: 2.34.0 Resolution: Fixed > Upgrade CheckStyle to 10.15.0 > - > > Key: ARTEMIS-4625 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4625 > Project: ActiveMQ Artemis > Issue Type: Dependency upgrade >Reporter: Justin Bertram >Assignee: Justin Bertram >Priority: Major > Fix For: 2.34.0 > > Time Spent: 20m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4625) Upgrade CheckStyle to 10.15.0
[ https://issues.apache.org/jira/browse/ARTEMIS-4625?focusedWorklogId=914828=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914828 ] ASF GitHub Bot logged work on ARTEMIS-4625: --- Author: ASF GitHub Bot Created on: 16/Apr/24 10:19 Start Date: 16/Apr/24 10:19 Worklog Time Spent: 10m Work Description: gemmellr merged PR #4884: URL: https://github.com/apache/activemq-artemis/pull/4884 Issue Time Tracking --- Worklog Id: (was: 914828) Time Spent: 20m (was: 10m) > Upgrade CheckStyle to 10.15.0 > - > > Key: ARTEMIS-4625 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4625 > Project: ActiveMQ Artemis > Issue Type: Dependency upgrade >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] [Commented] (ARTEMIS-1921) Setting client ID on core JMS should be reflected in broker RemotingConnection
[ https://issues.apache.org/jira/browse/ARTEMIS-1921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837645#comment-17837645 ] Robbie Gemmell commented on ARTEMIS-1921: - Not sure we should be expecting a response after 6 years, but it seems possible the code was a minimal attempt to show 'it isnt available on Core at all' rather than simply 'it is available at this point on the others', perhaps the use case is something else later where it is available on the others. Or maybe some behaviour changed in those 6 years and it used to be available; I actually think it might have in the AMQP case, I seem to recall it doing something odd like calling the auth methods when the first session opened like Core. Not sure it does that anymore. The ClientID wont be available at the point Qpid JMS actually goes through the SASL process, since it hasnt been sent yet, regardless how the client is configured, auth happens 'before connection' rather than during. If the broker fails the SASL negotiation, the client wont even get as far as starting a bare AMQP connection which is where the ClientId is carried as the container-id. I presume it is failing auth in this case and throwing. If it doenst fail auth, the test/application code will still throw with Qpid JMS since it is _both_ setting the ClientID up front 'administratively', and then also trying to set it after Connection creation, whereas you can only do one or the other. The second will throw an ISE if it gets that far. > Setting client ID on core JMS should be reflected in broker RemotingConnection > -- > > Key: ARTEMIS-1921 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1921 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: Broker >Affects Versions: 2.6.1 >Reporter: Johan Stenberg >Priority: Major > Attachments: Artemis1921_CoreJmsClient_SetClientId_Test.java > > Time Spent: 10m > Remaining Estimate: 0h > > As opposite to Qpid JMS Client over AMPQ1.0 or FuseSource StompJMS client > over STOMP, a clientID set on the JMS ConnectionFactory or the Connection in > the Artemis JMS Client is not available on the broker via > RemotingConnection#getClientID(). -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (ARTEMIS-4726) removeMessage(long) in the Joloquia API fails when the message is scheduled and has not been sent
Juanjo Marin created ARTEMIS-4726: - Summary: removeMessage(long) in the Joloquia API fails when the message is scheduled and has not been sent Key: ARTEMIS-4726 URL: https://issues.apache.org/jira/browse/ARTEMIS-4726 Project: ActiveMQ Artemis Issue Type: Bug Components: Web Console Affects Versions: 2.31.0 Environment: NAME="Oracle Linux Server" VERSION="8.6" ID="ol" ID_LIKE="fedora" VARIANT="Server" VARIANT_ID="server" VERSION_ID="8.6" PLATFORM_ID="platform:el8" PRETTY_NAME="Oracle Linux Server 8.6" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:oracle:linux:8:6:server" HOME_URL="https://linux.oracle.com/; BUG_REPORT_URL="https://bugzilla.oracle.com/; ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8" ORACLE_BUGZILLA_PRODUCT_VERSION=8.6 ORACLE_SUPPORT_PRODUCT="Oracle Linux" ORACLE_SUPPORT_PRODUCT_VERSION=8.6 java version "17.0.8" 2023-07-18 LTS Java(TM) SE Runtime Environment Oracle GraalVM 17.0.8+9.1 (build 17.0.8+9-LTS-jvmci-23.0-b14) Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.8+9.1 (build 17.0.8+9-LTS-jvmci-23.0-b14, mixed mode, sharing) Reporter: Juanjo Marin Attachments: Queue1.PNG, Queue2.PNG, Queue3.PNG, RemoveMessage1.PNG, RemoveMessage2.PNG, listScheduledMessage.PNG, listScheduledMessage.txt, listScheduledMessages2.txt, removeAll.PNG When we delete a scheduled message that has not yet been sent, it subtracts 2 from the message counter. This only happens when the message has not been delivered. The queue counter does not recover at any point, but the queue continues to function normally. If we remove all messages, the remaining ones are deleted, but the queue goes into negative. In one of our tests, the queue stopped functioning correctly and only messages could be inserted; it did not allow consuming them in any way. We haven't been able to reproduce it again. I attach screenshots and evidence. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914819=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914819 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 09:40 Start Date: 16/Apr/24 09:40 Worklog Time Spent: 10m Work Description: gemmellr commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1566979146 ## tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/MirroredVersionTest.java: ## @@ -106,7 +110,6 @@ public void testMirrorReplicat(int stringSize) throws Throwable { logger.debug("Starting live"); evaluate(mainClassloader, "multiVersionMirror/mainServer.groovy", serverFolder.getRoot().getAbsolutePath(), "1"); logger.debug("Starting backup"); - evaluate(backupClassLoader, "multiVersionMirror/backupServer.groovy", serverFolder.getRoot().getAbsolutePath(), "2"); Review Comment: This is being removed, but immediately above its still being logged that it is being done. The next thing that happens (before or after the sends) is not starting a backup. Seems like the log should be moved. ## tests/compatibility-tests/src/main/resources/multiVersionMirror/mainServer.groovy: ## @@ -39,10 +40,11 @@ configuration.setPersistenceEnabled(true); configuration.addAddressConfiguration(new CoreAddressConfiguration().setName("TestQueue").addRoutingType(RoutingType.ANYCAST)); configuration.addQueueConfiguration(new QueueConfiguration("TestQueue").setAddress("TestQueue").setRoutingType(RoutingType.ANYCAST)); +configuration.addAddressConfiguration(new CoreAddressConfiguration().setName("TestTopic").addRoutingType(RoutingType.MULTICAST)); try { AMQPBrokerConnectConfiguration connection = new AMQPBrokerConnectConfiguration("mirror", "tcp://localhost:61617").setReconnectAttempts(-1).setRetryInterval(100); -AMQPMirrorBrokerConnectionElement replication = new AMQPMirrorBrokerConnectionElement().setDurable(true).setSync(true).setMessageAcknowledgements(true); +AMQPMirrorBrokerConnectionElement replication = new AMQPMirrorBrokerConnectionElement().setDurable(true).setSync(false).setMessageAcknowledgements(true).setDurable(true); Review Comment: Added .setDurable(true) at end means it is being set twice since it was already being set true. ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + + if (headerPosition > deliveryAnnotationsPosition && headerPosition != VALUE_NOT_PRESENT && deliveryAnnotationsPosition != VALUE_NOT_PRESENT) { + // this is for a case where delivery annotations was swiched wrongly in a previous version + duplicate.position(deliveryAnnotationsPosition + encodedDeliveryAnnotationsSize); Review Comment: I dont really understand this. Is it trying to _handle_ the delivery-annotations having been written in the wrong place, in front of the header, in an old stored message? If so, how does setting the position to the end of the delivery annotations do that? Wouldnt that mean it was now positioned at the start of the illegally-positioned header...which we have already just written [if needed] previously a few lines earlier in this method? ## tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/MirroredVersionTest.java: ## @@ -154,4 +161,95 @@ public void testMirrorReplicat(int stringSize) throws Throwable { session.commit(); } } + + + @Test + public void testTopic() throws Throwable { + int stringSize = 100; + String body = createBody(stringSize); + logger.debug("Starting live"); + evaluate(mainClassloader, "multiVersionMirror/mainServer.groovy", serverFolder.getRoot().getAbsolutePath(), "1"); + logger.debug("Starting backup"); + evaluate(backupClassLoader, "multiVersionMirror/backupServer.groovy", serverFolder.getRoot().getAbsolutePath(), "2"); + + ConnectionFactory factoryMain = new JmsConnectionFactory("amqp://localhost:61616"); + + try (javax.jms.Connection connection = factoryMain.createConnection()) { + connection.setClientID("connection1"); + Session session = connection.createSession(true, Session.SESSION_TRANSACTED); + Topic topic = session.createTopic("TestTopic"); + MessageConsumer consumer =
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914820=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914820 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 09:40 Start Date: 16/Apr/24 09:40 Worklog Time Spent: 10m Work Description: gemmellr commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567054654 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + + if (headerPosition > deliveryAnnotationsPosition && headerPosition != VALUE_NOT_PRESENT && deliveryAnnotationsPosition != VALUE_NOT_PRESENT) { + // this is for a case where delivery annotations was swiched wrongly in a previous version + duplicate.position(deliveryAnnotationsPosition + encodedDeliveryAnnotationsSize); Review Comment: I dont really understand this. Is it trying to _handle_ the delivery-annotations having been written in the wrong place, in front of the header, in an old brokers stored message that gets sent? If so, how does setting the position to the end of the delivery annotations do that? Wouldnt that mean it was now positioned at the start of the illegally-positioned header...which we have already just written [if needed] previously a few lines earlier in this method? Issue Time Tracking --- Worklog Id: (was: 914820) Time Spent: 40m (was: 0.5h) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 40m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4725) Mirror may send wrong headers
[ https://issues.apache.org/jira/browse/ARTEMIS-4725?focusedWorklogId=914818=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914818 ] ASF GitHub Bot logged work on ARTEMIS-4725: --- Author: ASF GitHub Bot Created on: 16/Apr/24 09:33 Start Date: 16/Apr/24 09:33 Worklog Time Spent: 10m Work Description: erwindon commented on code in PR #4888: URL: https://github.com/apache/activemq-artemis/pull/4888#discussion_r1567052835 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java: ## @@ -825,8 +826,14 @@ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotatio } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); - // skip existing delivery annotations of the original message - duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); + + if (headerPosition > deliveryAnnotationsPosition && headerPosition != VALUE_NOT_PRESENT && deliveryAnnotationsPosition != VALUE_NOT_PRESENT) { + // this is for a case where delivery annotations was swiched wrongly in a previous version Review Comment: swiched --> switched? Issue Time Tracking --- Worklog Id: (was: 914818) Time Spent: 20m (was: 10m) > Mirror may send wrong headers > - > > Key: ARTEMIS-4725 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4725 > Project: ActiveMQ Artemis > Issue Type: Bug >Reporter: Clebert Suconic >Assignee: Clebert Suconic >Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > This is not specifically an issue in Mirroring or Broker Connection, but it > manifested as part of the broker connection codebase. > When a delivery for the first time after a reload happens, the delivery > annotation may be written before the header, breaking the specification. > Later on delivery the message, createDelieryCopy could get confused with the > positions: > https://github.com/apache/activemq-artemis/blob/50fae08b09a76e200ef107d06cc867231f644ccd/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java#L829 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (ARTEMIS-4716) Improve Jakarta Messaging / JMS documentation
[ https://issues.apache.org/jira/browse/ARTEMIS-4716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837616#comment-17837616 ] Daniel Martin edited comment on ARTEMIS-4716 at 4/16/24 9:21 AM: - OK, let me take a step back. I work routinely with Jakarta EE and am familiar with the basics. I find it isn't a common operation, however, to want to incorporate a third party tool in a way that integrates with the Jakarta EE ecosystem. Luckily, Apache ActiveMQ Artemis has such integration, through the "artemis-jakarta-client" package. I've been using this package for a while, only I've been manually instantiating some objects, and now I would like to take advantage of Artemis' integration with Jakarta and use dependency injection via CDI instead, as that seems more robust, and guessing that this is the recommended usage. What I would love to see, then, is an example of "artemis-jakarta-client" being used in whichever way was intended by the authors, in a working Jakarta EE project, for whichever Jakarta EE implementation. Has this ever been done? Has "artemis-jakarta-client" ever been used in a Jakarta EE project, either an example or a real-world one? {quote}If you need a JCA RA archive for ActiveMQ Artemis you can create one {quote} Regarding this point, I don't know if I need one or not. I saw this suggested in some online sources, but I'm not sure if it applies to my case – it really isn't easy to find clear information about the topic. Regardless, this is precisely the type of step that I expect the documentation to tell me whether I need or not. was (Author: JIRAUSER290941): OK, let me take a step back. I work routinely with Jakarta EE and am familiar with the basics. I find it isn't a common operation, however, to want to incorporate a third party tool in a way that integrates with the Jakarta EE ecosystem. Luckily, Apache ActiveMQ Artemis has such integration, through the "artemis-jakarta-client" package. I've been using this package for a while, only I've been manually instantiating some objects, and now I would like to take advantage of Artemis' integration with Jakarta and use dependency injection via CDI instead, as that seems more robust, and guessing that this is the recommended usage. What I would love to see, then, is an example of "artemis-jakarta-client" being used in whichever way was intended by the authors, in a working Jakarta EE project, for whichever Jakarta EE implementation. Has this ever been done? Has "artemis-jakarta-client" ever been used in a Jakarta EE project, either an example or a real-world one? > Improve Jakarta Messaging / JMS documentation > - > > Key: ARTEMIS-4716 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4716 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: JMS >Affects Versions: 2.33.0 >Reporter: Daniel Martin >Priority: Minor > > I'm struggling to understand [these > instructions|https://activemq.apache.org/components/artemis/documentation/latest/using-jms.html] > to use Artemis in the context of Jakarta Messaging which perhaps could be > updated / simplified / improved. > At the moment, I'm depending on {{artemis-jakarta-client}} and manually > instantiating {{ActiveMQConnectionFactory}}. While investigating a memory > leak that may come from my usage of ActiveMQ, I wanted to simplify this part > and rely on dependency injection instead. However, I don't begin to > understand how to do such thing. > My expectation was to be able to use the {{@Inject}} annotation to get a > reference to a {{ConnectionFactory}}, {{JMSContext}}, or similar and to be > able to provide configuration such as broker address and credentials > _somewhere_ as to end up with a reference to a {{Connection}} which is > ultimately what I need. Is this possible? What's the recommended way? Is > there any (working) reference examples? -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (ARTEMIS-4716) Improve Jakarta Messaging / JMS documentation
[ https://issues.apache.org/jira/browse/ARTEMIS-4716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837616#comment-17837616 ] Daniel Martin commented on ARTEMIS-4716: OK, let me take a step back. I work routinely with Jakarta EE and am familiar with the basics. I find it isn't a common operation, however, to want to incorporate a third party tool in a way that integrates with the Jakarta EE ecosystem. Luckily, Apache ActiveMQ Artemis has such integration, through the "artemis-jakarta-client" package. I've been using this package for a while, only I've been manually instantiating some objects, and now I would like to take advantage of Artemis' integration with Jakarta and use dependency injection via CDI instead, as that seems more robust, and guessing that this is the recommended usage. What I would love to see, then, is an example of "artemis-jakarta-client" being used in whichever way was intended by the authors, in a working Jakarta EE project, for whichever Jakarta EE implementation. Has this ever been done? Has "artemis-jakarta-client" ever been used in a Jakarta EE project, either an example or a real-world one? > Improve Jakarta Messaging / JMS documentation > - > > Key: ARTEMIS-4716 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4716 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: JMS >Affects Versions: 2.33.0 >Reporter: Daniel Martin >Priority: Minor > > I'm struggling to understand [these > instructions|https://activemq.apache.org/components/artemis/documentation/latest/using-jms.html] > to use Artemis in the context of Jakarta Messaging which perhaps could be > updated / simplified / improved. > At the moment, I'm depending on {{artemis-jakarta-client}} and manually > instantiating {{ActiveMQConnectionFactory}}. While investigating a memory > leak that may come from my usage of ActiveMQ, I wanted to simplify this part > and rely on dependency injection instead. However, I don't begin to > understand how to do such thing. > My expectation was to be able to use the {{@Inject}} annotation to get a > reference to a {{ConnectionFactory}}, {{JMSContext}}, or similar and to be > able to provide configuration such as broker address and credentials > _somewhere_ as to end up with a reference to a {{Connection}} which is > ultimately what I need. Is this possible? What's the recommended way? Is > there any (working) reference examples? -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4709) Add a plugin to provide periodic expiry of connections on a per acceptor basis
[ https://issues.apache.org/jira/browse/ARTEMIS-4709?focusedWorklogId=914814=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914814 ] ASF GitHub Bot logged work on ARTEMIS-4709: --- Author: ASF GitHub Bot Created on: 16/Apr/24 09:05 Start Date: 16/Apr/24 09:05 Worklog Time Spent: 10m Work Description: gtully commented on PR #4871: URL: https://github.com/apache/activemq-artemis/pull/4871#issuecomment-2058602117 on the config change, if a similar feature became available in the core, it would never be a breaking change, it would require a config change, but not a break. new config would be needed and the plugin removed. But more generally, on plugins for "users", I think it is an extension point, but we are all users! Issue Time Tracking --- Worklog Id: (was: 914814) Time Spent: 2h (was: 1h 50m) > Add a plugin to provide periodic expiry of connections on a per acceptor basis > -- > > Key: ARTEMIS-4709 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4709 > Project: ActiveMQ Artemis > Issue Type: New Feature > Components: Broker >Affects Versions: 2.33.0 >Reporter: Gary Tully >Assignee: Gary Tully >Priority: Major > Fix For: 2.34.0 > > Time Spent: 2h > Remaining Estimate: 0h > > When credential rotation needs to be enforced, active connections need to be > terminated on some timeline to ensure credentials are reevaluated. There are > management apis that can be used but these require some intervention. > In addition to enforce some SLA around duration of connections, having an > easy way to limit connections to a given maximum period can be helpful. > A plugin that will be applied on an per acceptor basis, that can be used to > disconnect connections that have lived for some period can provide a nice > building block for these use cases. -- This message was sent by Atlassian Jira (v8.20.10#820010)