Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I fix a new ActiveMQ Artemis install blocking issue?

I've been tasked with evaluating activemq-artemis for JMS clients. I have RabbmitMQ experience, but none with activemq-artemis/JMS.

I installed artemis to my local machine, created a new broker per the instructions, and set it up as a windows service. The windows service starts and stops just fine. I've made no changes to the broker.xml file.

For my first test I'm trying to perform a JMS Queue produce/consume from a stand alone java program. I'm using the code from the Artemis User Manual in the Using JMS section, (without using JNDI):

TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName());
ConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,transportConfiguration);

Queue orderQueue = ActiveMQJMSClient.createQueue("OrderQueue");
Connection connection = cf.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

MessageProducer producer = session.createProducer(orderQueue);
MessageConsumer consumer = session.createConsumer(orderQueue);

connection.start();

TextMessage message = session.createTextMessage("This is an order");
producer.send(message);

TextMessage receivedMessage = (TextMessage)consumer.receive();
System.out.println("Got order: " + receivedMessage.getText());

When I run this code, I get the following error:

WARN: AMQ212054: Destination address=jms.queue.OrderQueue is blocked. If the system is configured to block make sure you consume messages on this configuration.

My research hasn't been conclusive on if this is a server side setting, or having the producer send without blocking. I haven't been able to find a producer send method that has a blocking boolean, only persistence. Any ideas on where to focus? Thanks.

Edit: new address-setting element added to broker.xml dedicated to this Queue:

<address-setting match="jms.queue.OrderQueue">
            <max-size-bytes>104857600</max-size-bytes>
            <page-size-bytes>10485760</page-size-bytes>
            <address-full-policy>PAGE</address-full-policy>
</address-setting>
like image 509
user640118 Avatar asked Jun 23 '17 16:06

user640118


People also ask

Is ActiveMQ Artemis production ready?

Is ActiveMQ Artemis Production-Ready? The short answer here is yes, with some caveats. Artemis began its life with the very important advantage that it is built upon two battle-hardened messaging technologies.

What is the difference between ActiveMQ and ActiveMQ Artemis?

Generally speaking, ActiveMQ Artemis is notably faster than ActiveMQ "Classic" due to the significant architectural differences between them. In short, ActiveMQ Artemis was designed to be completely non-blocking and performs very well at scale compared to ActiveMQ "Classic".


1 Answers

I found this on further research in the user manual:

max-disk-usage The max percentage of data we should use from disks. The System will block while the disk is full. Default=100

and in the log after service startup with no messages published yet:

WARN [org.apache.activemq.artemis.core.server] AMQ222210: Storage usage is beyond max-disk-usage. System will start blocking producers.

so I think no matter my address settings, it would start to block. Looking at the max-disk-usage setting in broker.xml, it was set to 90. Documentation default says 100, I set to that, no startup log warnings, and my test pub/sub code now works.

like image 144
user640118 Avatar answered Oct 09 '22 21:10

user640118