You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by "jbertram (via GitHub)" <gi...@apache.org> on 2025/01/17 19:47:40 UTC

[PR] ARTEMIS-2490 mitigate NumberFormatException when parsing large message [activemq-artemis]

jbertram opened a new pull request, #5457:
URL: https://github.com/apache/activemq-artemis/pull/5457

   No specific test here as static analysis is sufficient in my opinion. This is really just an abundance of caution since there's been a report of this in the community.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] ARTEMIS-2490 mitigate NumberFormatException when parsing large message [activemq-artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram commented on code in PR #5457:
URL: https://github.com/apache/activemq-artemis/pull/5457#discussion_r1920717475


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java:
##########
@@ -354,12 +354,18 @@ protected LargeServerMessage parseLargeMessage(final ActiveMQBuffer buff) throws
       largeMessage.setStorageManager(this);
 
       if (largeMessage.toMessage().containsProperty(Message.HDR_ORIG_MESSAGE_ID)) {
-         // for compatibility: couple with old behaviour, copying the old file to avoid message loss
-         long originalMessageID = largeMessage.toMessage().getLongProperty(Message.HDR_ORIG_MESSAGE_ID);
-
          SequentialFile currentFile = createFileForLargeMessage(largeMessage.toMessage().getMessageID(), true);
 
          if (!currentFile.exists()) {
+            // for compatibility: couple with old behaviour, copying the old file to avoid message loss
+            String originalMessageIDString = largeMessage.toMessage().getStringProperty(Message.HDR_ORIG_MESSAGE_ID);
+            // could have a leading "ID:", like ID:c6e2e367-d77e-11e9-9471-005056b7cdce

Review Comment:
   You're right, @tabish121. That's a fatal flaw.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] ARTEMIS-2490 mitigate NumberFormatException when parsing large message [activemq-artemis]

Posted by "tabish121 (via GitHub)" <gi...@apache.org>.
tabish121 commented on code in PR #5457:
URL: https://github.com/apache/activemq-artemis/pull/5457#discussion_r1920696558


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java:
##########
@@ -354,12 +354,18 @@ protected LargeServerMessage parseLargeMessage(final ActiveMQBuffer buff) throws
       largeMessage.setStorageManager(this);
 
       if (largeMessage.toMessage().containsProperty(Message.HDR_ORIG_MESSAGE_ID)) {
-         // for compatibility: couple with old behaviour, copying the old file to avoid message loss
-         long originalMessageID = largeMessage.toMessage().getLongProperty(Message.HDR_ORIG_MESSAGE_ID);
-
          SequentialFile currentFile = createFileForLargeMessage(largeMessage.toMessage().getMessageID(), true);
 
          if (!currentFile.exists()) {
+            // for compatibility: couple with old behaviour, copying the old file to avoid message loss
+            String originalMessageIDString = largeMessage.toMessage().getStringProperty(Message.HDR_ORIG_MESSAGE_ID);
+            // could have a leading "ID:", like ID:c6e2e367-d77e-11e9-9471-005056b7cdce

Review Comment:
   The comment seems to acknowledge that what follows the prefix for many of the clients is not going to be a long but likely a UUID or something UUID like for say OpenWire which in that case is going to throw a NumberFormatException again only the exception is from a String without the "ID:" prefix so I'm unclear how this really improves things?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] ARTEMIS-2490 mitigate NumberFormatException when parsing large message [activemq-artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram closed pull request #5457: ARTEMIS-2490 mitigate NumberFormatException when parsing large message
URL: https://github.com/apache/activemq-artemis/pull/5457


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact