ARTEMIS compressing large messages

Latest response

I want to use message compression and I have added to my brokerUrl the following parameters:
- tcp://localhost:61616?minLargeMessageSize=1000000&compressLargeMessages=true

When I start my JMS message producer, a warning is logged:
- WARN: AMQ212078: Connection factory parameter ignored compressLargeMessages.

I'm injecting 3MB text messages using this connection factory class org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory

int messageCount = 10;
ConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:61616?minLargeMessageSize=1000000&compressLargeMessages=true");
Connection conection = factory.createConnection();
Session session = connection.createSession();
MessageProducer producer = session.createProducer(NON_PERSISTENT);

Instant start = Instant.now();

TextMessage message = session.createTextMessage(format("Text message (UUID: %s): %s", UUID.randomUUID(), bigMessage)); // message is 3MB big
for (float count = messageCount; count > 0; count--) {
  producer.send(destination, message);
}

Long duration = Duration.between(start, Instant.now()).toMillis();

How is the compression option supposed to work ?

Responses