[
https://issues.apache.org/jira/browse/ARTEMIS-4649?focusedWorklogId=905750&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-905750
]
ASF GitHub Bot logged work on ARTEMIS-4649:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 19/Feb/24 18:30
Start Date: 19/Feb/24 18:30
Worklog Time Spent: 10m
Work Description: jbertram commented on code in PR #4825:
URL: https://github.com/apache/activemq-artemis/pull/4825#discussion_r1494916248
##########
artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java:
##########
@@ -344,7 +348,8 @@ public StompFrame createMessageFrame(ICoreMessage
serverMessage, StompSubscripti
}
frame.setByteBody(data);
- StompUtils.copyStandardHeadersFromMessageToFrame((serverMessage), frame,
deliveryCount);
+ frame.addHeader(Stomp.Headers.Message.MESSAGE_ID,
String.valueOf(consumer.getID()) + StompSession.MESSAGE_ID_SEPARATOR +
String.valueOf(serverMessage.getMessageID()));
Review Comment:
Message and consumer IDs should never be < 0 so the potential values are 0
(1 character) through 9223372036854775807 (19 characters). Since these
characters are just digits (i.e. part of ISO-8859-1) then they will be
represented by a single byte in the `byte[]` that backs the `String`. We want
to avoid expanding the backing array but we also want to avoid over-allocating
(and therefore wasting) space. Ten characters for each long seems like a fair
middle ground.
Issue Time Tracking
-------------------
Worklog Id: (was: 905750)
Time Spent: 1h (was: 50m)
> STOMP message IDs are not unique when same message is received on multiple
> subscriptions
> ----------------------------------------------------------------------------------------
>
> Key: ARTEMIS-4649
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4649
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: STOMP
> Affects Versions: 2.33.0
> Reporter: Albertas Vyšniauskas
> Assignee: Justin Bertram
> Priority: Major
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Hello,
> currently core message ID is converted to string and used for STOMP
> message-id and ack header values, but this ID will not be unique if the same
> message is delivered to multiple subscriptions on the same connection. This
> will cause error and connection close after attempt to acknowledge the second
> message containing already acknowledged ID when using client or
> client-individual acknowledgement mode.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)