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

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

                Author: ASF GitHub Bot
            Created on: 19/Feb/24 14:48
            Start Date: 19/Feb/24 14:48
    Worklog Time Spent: 10m 
      Work Description: jbertram commented on code in PR #4825:
URL: https://github.com/apache/activemq-artemis/pull/4825#discussion_r1494660680


##########
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:
   This is going to be done for every message dispatched from the broker so it 
would be worth making this is as fast as possible. Perhaps something like:
   ```java
   frame.addHeader(Stomp.Headers.Message.MESSAGE_ID, new 
StringBuilder(32).append(consumer.getID()).append(StompSession.MESSAGE_ID_SEPARATOR).append(serverMessage.getMessageID()).toString());
   ```





Issue Time Tracking
-------------------

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

> 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: 20m
>  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)

Reply via email to