Hello.

Standalone broker conf:
<address-full-policy>PAGE</address-full-policy>
<page-size-bytes>1048576</page-size-bytes>

Other settings are default.

"tcp://localhost:61616" - is the "artemis" multiprotocol acceptor

Normal case:
Behaviour: Paging works.
Client: artemis-jms-client v1.2.0
Class: org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
Code:
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616", user, pass);
Connection connection = connectionFactory.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Queue queue = session.createQueue("tmpQueue");
MessageProducer producer = session.createProducer(queue);
connection.start();

byte[] bytes = new byte[Integer.parseInt(size)];
Random random = new Random();

whilt (true) {
    BytesMessage bytesMessage = session.createBytesMessage();
    random.nextBytes(bytes);
    bytesMessage.writeBytes(bytes);
    producer.send(bytesMessage);
}

Error case:
Behaviour: Paging DO NOT works. When messages fills queue to the max-size-bytes setting, JMX's Address.Paging becomes true, page file is created, page files count becomes 1, but producer freezes until consumer start working. Log tells that paging is starting, so it should be ok, but id didn't. No additional messages even if I set Trace level. Client: activemq-client v5.12.0 (Also tried latest 5.13.2, no difference)
Class: org.apache.activemq.ActiveMQConnectionFactory
Code:
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, pass, "tcp://localhost:61616");
// the same code after ConnectionFactory as for artemis-jms-client ...

Is this a bug or I just cook it wrong?

Thank you.

Reply via email to