3

I'm trying to connect to a remote Artemis 2.6.3 sender using Spring Boot 2.1.1.RELEASE. In all the examples I've found so far the sender hangs when it attempts to send a message (e.g. here). The following log is displayed on the console:

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

I've verified that the queue has not been configured to BLOCK in broker.xml. Is there a bug in spring-boot-starter-artemis or ActiveMQ Artemis?

My broker.xml:

<?xml version='1.0'?>

<configuration xmlns="urn:activemq"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xi="http://www.w3.org/2001/XInclude"
               xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">

   <core xmlns="urn:activemq:core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="urn:activemq:core ">

      <name>0.0.0.0</name>
      <persistence-enabled>true</persistence-enabled>
      <journal-type>ASYNCIO</journal-type>
      <paging-directory>data/paging</paging-directory>
      <bindings-directory>data/bindings</bindings-directory>
      <journal-directory>data/journal</journal-directory>
      <large-messages-directory>data/large-messages</large-messages-directory>
      <journal-datasync>true</journal-datasync>
      <journal-min-files>2</journal-min-files>
      <journal-pool-files>10</journal-pool-files>
      <journal-file-size>10M</journal-file-size>
      <journal-buffer-timeout>156000</journal-buffer-timeout>
      <journal-max-io>4096</journal-max-io>
      <disk-scan-period>5000</disk-scan-period>
      <max-disk-usage>90</max-disk-usage>
      <critical-analyzer>true</critical-analyzer>
      <critical-analyzer-timeout>120000</critical-analyzer-timeout>
      <critical-analyzer-check-period>60000</critical-analyzer-check-period>
      <critical-analyzer-policy>HALT</critical-analyzer-policy>

      <acceptors>
         <!-- Acceptor for every supported protocol -->
         <acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>
         <!-- AMQP Acceptor.  Listens on default AMQP port for AMQP traffic.-->
         <acceptor name="amqp">tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>
         <!-- STOMP Acceptor. -->
         <acceptor name="stomp">tcp://0.0.0.0:61613?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true</acceptor>
         <!-- HornetQ Compatibility Acceptor.  Enables HornetQ Core and STOMP for legacy HornetQ clients. -->
         <acceptor name="hornetq">tcp://0.0.0.0:5445?anycastPrefix=jms.queue.;multicastPrefix=jms.topic.;protocols=HORNETQ,STOMP;useEpoll=true</acceptor>
         <!-- MQTT Acceptor -->
         <acceptor name="mqtt">tcp://0.0.0.0:1883?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true</acceptor>
      </acceptors>

      <security-settings>
         <security-setting match="#">
            <permission type="createNonDurableQueue" roles="amq"/>
            <permission type="deleteNonDurableQueue" roles="amq"/>
            <permission type="createDurableQueue" roles="amq"/>
            <permission type="deleteDurableQueue" roles="amq"/>
            <permission type="createAddress" roles="amq"/>
            <permission type="deleteAddress" roles="amq"/>
            <permission type="consume" roles="amq"/>
            <permission type="browse" roles="amq"/>
            <permission type="send" roles="amq"/>
            <!-- we need this otherwise ./artemis data imp wouldn't work -->
            <permission type="manage" roles="amq"/>
         </security-setting>
      </security-settings>

      <address-settings>
         <!-- if you define auto-create on certain queues, management has to be auto-create -->
         <address-setting match="activemq.management#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-address>ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <!-- with -1 only the global-max-size is in use for limiting -->
            <max-size-bytes>-1</max-size-bytes>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
         </address-setting>
         <!--default for catch all-->
         <address-setting match="#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-address>ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <!-- with -1 only the global-max-size is in use for limiting -->
            <max-size-bytes>-1</max-size-bytes>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
         </address-setting>
      </address-settings>

      <addresses>
         <address name="DLQ">
            <anycast>
               <queue name="DLQ" />
            </anycast>
         </address>
         <address name="ExpiryQueue">
            <anycast>
               <queue name="ExpiryQueue" />
            </anycast>
         </address>
         <address name="demoQueue">
            <anycast>
               <queue name="demoQueue" />
            </anycast>        
         </address>
      </addresses>

   </core>
</configuration>
Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
Francesco Marchioni
  • 4,091
  • 1
  • 25
  • 40
  • Can you paste the broker.xml from your Artemis instance? – Justin Bertram Dec 17 '18 at 16:49
  • Thanks Justin, I've copied it. It's almost the default, except for the Queue definition – Francesco Marchioni Dec 18 '18 at 14:30
  • In case that might help someone someday: I had the same error using the Artemis server embedded in Wildfly. In my case the issue was occuring interminently when the server was almost running out of memory and was doing very long Garbage Collector pauses. – Guillaume Dec 14 '20 at 08:38

1 Answers1

8

There are multiple reasons that the broker might block messages from being sent to an address:

  1. If the <address-full-policy> is BLOCK and the address has reached the configured <max-size-bytes>.
  2. If the <address-full-policy> is BLOCK and the <global-max-size> for all addresses is reached.
  3. If the <max-disk-usage> is reached.

My guess is that you're hitting #3. Therefore, I recommend you increase your max-disk-usage from 90 to 100, e.g.:

<max-disk-usage>100</max-disk-usage>

Keep in mind that max-disk-usage is not the amount of disk that the broker itself has used, but the total amount of disk used. Therefore, if you have used 90% of your disk (i.e. only 10% free space left) then the broker will block.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • 2
    Just to add, for a newbie such as myself, max-disk-usage is not the amount of disk usage that activemq has somehow "used up", it appears it's just the max disk usage of the disk that activemq is running on. In my case I had less than 10% of my C drive available, hence this error. – JL_SO Jul 04 '20 at 20:26
  • Thanks @JL_SO my case was the same, less than 10% in my disk. BTW you can get where store data docker with command `docker info`. – pazfernando Feb 05 '21 at 20:56