You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Roberto <ko...@yahoo.es.INVALID> on 2021/11/18 14:58:19 UTC

Parameter address-full-policy BLOCK does not work

Hi all,
In certain configurations the address-full-policy set to BLOCK does not work in Artemis 2.17.0.
The following configuration:
      <address-settings>
         <address-setting match="events.inject">
            <max-size-bytes>50Mb</max-size-bytes>
            <address-full-policy>BLOCK</address-full-policy>
         </address-setting>
      </address-settings>
      <addresses>
         <address name="events.inject">
            <anycast>
               <queue name="events.inject">
               </queue>
            </anycast>
         </address>
      </addresses>
This code never blocks events.inject and if you ingest faster than the consumer it grows until Artemis runs out of memory. It should grow until the 50 Megabytes are reached and then block until the queue is removed.
According to https://activemq.apache.org/components/artemis/documentation/latest/paging.html it should block until there is space available.
Setting the policy to PAGE or FAIL works plus sends a log when the limit is hit.
Am I missing something or is it a bug in Artemis?

Full configuration below:
<?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>artemis-ext (mpmt-gems-artemis-02)</name>
      <persistence-enabled>true</persistence-enabled>
      <journal-type>NIO</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>
      <global-max-size>400Mb</global-max-size>
      <acceptors>
         <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;supportAdvisory=false;batchDelay=50;directDeliver=true;nioRemotingThreads=4</acceptor>
      </acceptors>
      <security-enabled>false</security-enabled>
      <address-settings>
         <address-setting match="events.inject">
            <max-size-bytes>50Mb</max-size-bytes>
            <address-full-policy>BLOCK</address-full-policy>
         </address-setting>
      </address-settings>
      <addresses>
         <address name="events.inject">
            <anycast>
               <queue name="events.inject">
               </queue>
            </anycast>
         </address>
      </addresses>
   </core>
</configuration>

Re: Parameter address-full-policy BLOCK does not work

Posted by Justin Bertram <jb...@apache.org>.
The "producer-window-size" on the bridge defaults to "-1" which means it
won't bother asking for credits from the broker. So when the broker tries
to block the producer by withholding credits it won't matter. You need to
set the "producer-window-size" on the bridge to something > 0.


Justin

On Thu, Nov 18, 2021 at 9:48 AM Roberto <ko...@yahoo.es.invalid> wrote:

> Thank you for the answer, Justin.
> I'm using another Artemis instance with a bridge sending data to this one.
> I've seen Artemis enforcing this limit when using Java clients and writing
> the corresponding entry in the log file. We sometimes get a log indicating
> that the limit is reached:
> 2021-11-18 15:41:49,529 WARN  [org.apache.activemq.artemis.core.server]
> AMQ222183: Blocking message production on address 'events.inject'; size is
> currently: 56,183,147 bytes; max-size-bytes on address: 52,428,800,
> global-max-size is 56,183,147
> But the queue still grows regardless of the message:
> $ date; /opt/facilities/artemis/conf/broker/bin/artemis queue stat|head
> -2; for I in 1 2; do /opt/facilities/artemis/conf/broker/bin/artemis queue
> stat|grep events.inject|grep -v relay; sleep 5; done
> Thu 18 Nov 15:45:54 UTC 2021
> Connection brokerURL = tcp://localhost:61616
> |NAME                     |ADDRESS                  |CONSUMER_COUNT
> |MESSAGE_COUNT |MESSAGES_ADDED |DELIVERING_COUNT |MESSAGES_ACKED
> |SCHEDULED_COUNT |ROUTING_TYPE |
> |events.inject            |events.inject            |0
> |447121        |447121         |0                |0              |0
>        |ANYCAST      |
> |events.inject            |events.inject            |0
> |457246        |457246         |0                |0              |0
>        |ANYCAST      |
>
>

Re: Parameter address-full-policy BLOCK does not work

Posted by Roberto <ko...@yahoo.es.INVALID>.
Thank you for the answer, Justin.
I'm using another Artemis instance with a bridge sending data to this one.
I've seen Artemis enforcing this limit when using Java clients and writing the corresponding entry in the log file. We sometimes get a log indicating that the limit is reached:
2021-11-18 15:41:49,529 WARN  [org.apache.activemq.artemis.core.server] AMQ222183: Blocking message production on address 'events.inject'; size is currently: 56,183,147 bytes; max-size-bytes on address: 52,428,800, global-max-size is 56,183,147
But the queue still grows regardless of the message:
$ date; /opt/facilities/artemis/conf/broker/bin/artemis queue stat|head -2; for I in 1 2; do /opt/facilities/artemis/conf/broker/bin/artemis queue stat|grep events.inject|grep -v relay; sleep 5; done
Thu 18 Nov 15:45:54 UTC 2021
Connection brokerURL = tcp://localhost:61616
|NAME                     |ADDRESS                  |CONSUMER_COUNT |MESSAGE_COUNT |MESSAGES_ADDED |DELIVERING_COUNT |MESSAGES_ACKED |SCHEDULED_COUNT |ROUTING_TYPE |
|events.inject            |events.inject            |0              |447121        |447121         |0                |0              |0               |ANYCAST      |
|events.inject            |events.inject            |0              |457246        |457246         |0                |0              |0               |ANYCAST      |

Re: Parameter address-full-policy BLOCK does not work

Posted by Justin Bertram <jb...@apache.org>.
I don't recall any issues with BLOCK which we've fixed in 2.18.0 or 2.19.0
and all the tests are passing. It certainly could be a new bug, but we'd
need more details to confirm.

First off, what kind of client are you using to send the messages?


Justin

On Thu, Nov 18, 2021 at 8:58 AM Roberto <ko...@yahoo.es.invalid> wrote:

> Hi all,
> In certain configurations the address-full-policy set to BLOCK does not
> work in Artemis 2.17.0.
> The following configuration:
>       <address-settings>
>          <address-setting match="events.inject">
>             <max-size-bytes>50Mb</max-size-bytes>
>             <address-full-policy>BLOCK</address-full-policy>
>          </address-setting>
>       </address-settings>
>       <addresses>
>          <address name="events.inject">
>             <anycast>
>                <queue name="events.inject">
>                </queue>
>             </anycast>
>          </address>
>       </addresses>
> This code never blocks events.inject and if you ingest faster than the
> consumer it grows until Artemis runs out of memory. It should grow until
> the 50 Megabytes are reached and then block until the queue is removed.
> According to
> https://activemq.apache.org/components/artemis/documentation/latest/paging.html
> it should block until there is space available.
> Setting the policy to PAGE or FAIL works plus sends a log when the limit
> is hit.
> Am I missing something or is it a bug in Artemis?
>
> Full configuration below:
> <?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>artemis-ext (mpmt-gems-artemis-02)</name>
>       <persistence-enabled>true</persistence-enabled>
>       <journal-type>NIO</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>
>       <global-max-size>400Mb</global-max-size>
>       <acceptors>
>          <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;supportAdvisory=false;batchDelay=50;directDeliver=true;nioRemotingThreads=4
> </acceptor>
>       </acceptors>
>       <security-enabled>false</security-enabled>
>       <address-settings>
>          <address-setting match="events.inject">
>             <max-size-bytes>50Mb</max-size-bytes>
>             <address-full-policy>BLOCK</address-full-policy>
>          </address-setting>
>       </address-settings>
>       <addresses>
>          <address name="events.inject">
>             <anycast>
>                <queue name="events.inject">
>                </queue>
>             </anycast>
>          </address>
>       </addresses>
>    </core>
> </configuration>
>
>