I can't figure out how to get LargeMessage in an Artemis ActiveMQ queue using JMS. I didn't find any get method in the Message class. There are different methods for getting message ID, lifetime and others, but I didn’t find any for getting LargeMessage
The "large" message support provided by ActiveMQ Artemis is specific to ActiveMQ Artemis. It is not part of the JMS API.
That said, in most circumstances you can use the JMS API to read the _AMQ_LARGE_SIZE
message property. If such a property exists then the message is considered "large", e.g.:
boolean isLarge = false;
Enumeration propertyNames = jmsMessage.getPropertyNames();
while (propertyNames.hasMoreElements()) {
if (propertyNames.nextElement().equals("_AMQ_LARGE_SIZE")) {
isLarge = true;
break;
}
}
It's worth noting that one of the goals of "large" message support is that the clients won't actually know that the message is "large" so that they can work with both normal and "large" messages with no changes.