Menu Search

14.13. Configuring DLQs/Maximum Delivery Count

In the below configuration it can be seen that DLQs/Maximum Delivery Count are enabled at the virtual host "localhost" with maximum delivery count set to 5 and disable for virtual host "dev-only".

As 'dev-only-main-queue' has its own configuration specified, this value overrides all others and causes the features to be enabled for this queue. In contrast to this, 'dev-only-other-queue' does not specify its own value and picks up the false value specified for its parent virtualhost, causing the DLQ/Maximum Delivery Count features to be disabled for this queue. Any such queue in the 'dev-only' virtualhost which does not specify its own configuration value will have the DLQ/Maximum Delivery Count feature disabled.

The queue 'localhost-queue' has the DLQ/Maximum Delivery Count features disabled. Any other queue in the 'localhost' virtualhost which does not specify its own configuration value will have the features enabled (inherited from parent virtual host).

Example 14.17. Enabling DLQs and maximum delivery count at virtualhost and queue level within virtualhosts.xml

<virtualhosts>
 ...
 <virtualhost>
  <name>dev-only</name>
  <dev-only>
   <queues>
    <deadLetterQueues>false</deadLetterQueues>
    <maximumDeliveryCount>0</maximumDeliveryCount>
    <queue>
     <name>dev-only-main-queue</name>
     <dev-only-main-queue>
      <deadLetterQueues>true</deadLetterQueues>
      <maximumDeliveryCount>3</maximumDeliveryCount>
     </dev-only-main-queue>
    </queue>
    <queue>
     <name>dev-only-other-queue</name>
    </queue>
   </queues>
  </dev-only>
 </virtualhost>
 <virtualhost>
  <name>localhost</name>
  <localhost>
   <queues>
    <deadLetterQueues>true</deadLetterQueues>
    <maximumDeliveryCount>5</maximumDeliveryCount>
    <queue>
     <name>localhost-queue</name>
     <deadLetterQueues>false</deadLetterQueues>
    </queue>
   </queues>
  </localhost>
 </virtualhost>
 ...
</virtualhosts>