23.3. Configuring Queues Through Address Settings

There are some attributes that are defined against an address wildcard rather than a specific queue. Here is an example of an address-setting entry that would be found in the <JBOSS_HOME>/jboss-as/server/<PROFILE>/deploy/hornetq/hornetq-configuration.xml file.
<address-settings>
   <address-setting match="jms.queue.exampleQueue">
      <dead-letter-address>jms.queue.deadLetterQueue</dead-letter-address>
      <max-delivery-attempts>3</max-delivery-attempts>
      <redelivery-delay>5000</redelivery-delay>
      <expiry-address>jms.queue.expiryQueue</expiry-address>
      <last-value-queue>true</last-value-queue>        
      <max-size-bytes>100000</max-size-bytes>
      <page-size-bytes>20000</page-size-bytes>
      <redistribution-delay>0</redistribution-delay>
      <send-to-dla-on-no-route>true</send-to-dla-on-no-route>
      <address-full-policy>PAGE</address-full-policy>
   </address-setting>
</address-settings>
Address settings allow you to provide a block of settings which will be applied against any addresses that match the string in the match attribute. In the above example the settings would only be applied to any addresses which exactly match the address jms.queue.exampleQueue, but you can also use wildcards to apply sets of configuration against many addresses. The wildcard syntax used is described in Chapter 11, Understanding the HornetQ Wildcard Syntax
For example, if you used the match string jms.queue.# the settings would be applied to all addresses which start with jms.queue. which would be all JMS queues.
The meaning of the specific settings are explained fully throughout the user manual, however here is a brief description with a link to the appropriate chapter if available.
max-delivery-attempts
Defines how many times a canceled message can be redelivered before sending it to the dead-letter-address. A full explanation can be found in Section 19.2.1, “Configuring Dead Letter Addresses”.
redelivery-delay
Defines how long to wait before attempting redelivery of a canceled message. Refer to Section 19.1.1, “Configuring Delayed Redelivery”.
expiry-address
Defines where to send a message that has expired. Refer to Section 20.2, “Configuring Expiry Addresses”.
last-value-queue
Defines whether a queue only uses last values or not. Refer to Chapter 25, Last-Value Queues.
max-size-bytes and page-size-bytes
Are used to set paging on an address. This is explained in Chapter 22, Paging.
redistribution-delay
Defines how long to wait when the last consumer is closed on a queue before redistributing any messages. See Section 36.6, “Message Redistribution”.
send-to-dla-on-no-route
If a message is sent to an address, but the server does not route it to any queues, (for example, there might be no queues bound to that address, or none of the queues have filters that match) then normally that message would be discarded. However if this parameter is set to true for that address, if the message is not routed to any queues it will instead be sent to the dead letter address (DLA) for that address, if it exists.
address-full-policy
This attribute can have one of the following values: PAGE, DROP or BLOCK and determines what happens when an address where max-size-bytes is specified becomes full. The default value is PAGE. If the value is PAGE then further messages will be paged to disk.
  • If the value is DROP then further messages will be silently dropped.
  • If the value is BLOCK then client message producers will block when they try and send further messages.
See the following chapters for more info Chapter 17, Flow Control, Chapter 22, Paging.