Affects Version/s: 5.15.6, 5.15.9
Fix Version/s: None
MacOS + Docker:
docker run -p 61616:61616 -p 61614:61614 -p 8161:8161 -it -v conf:/opt/activemq/conf -v data:/opt/activemq/data rmohr/activemq
Tested with Node.js https://www.npmjs.com/package/@stomp/stompjs stompjs client and with WireShark to debug raw messages sent from broker to client.
I am connecting to ActiveMQ with STOMP over websocket. When I publish message(s) with JMSXGroupID the header is correctly set on message(s) (visible in GUI). The grouping algorithm also works correctly (messages from same group are directed to single consumer - I tested this). However JMSXGroupID header (and any other header containing group) is not attached to message sent from broker to client. On the other hand any custom user-defined headers (like "custom-header") are correctly both set on message sent by producer and received by consumer.
Here is dump of raw message (using WireShark) sent form broker to client. It should have JMSXGroupID but it's missing.
test message 2
This causes issue that when consumer/subscription has activemq.prefetchSize > 1 then it's not possible process messages from same groups on consumer side in correct order (assuming here that consumer "manually" ACKs each message ack: client-individual).
MSG1: group = A
MSG2: group = A
MSG3: group = B
MSG4: group = B
When prefetchSize = 4 and consumer receives those 4 messages "at once" (let's say there is only one consumer so it receives all groups) then it's not possible by consumer to guess which of those messages can be processed and ACKed in parallel and which sequentially.
What I tracked so far is that this test https://github.com/apache/activemq/blob/9abe2c6f97c92fc99c5a2ef02846f62002a671cf/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/Stomp11Test.java#L703 does not operate on what ActiveMQ sent over STOMP - instead it uses JMS Consumer to test how message is delivered.