We support a number of different policies which can be attached to individual destinations (queues, topics) or to wildcards of queue/topic hierarchies. This makes it easy to configure how different regions of the JMS destination space are handled.
The properties you can set on a Destination are as follows:
| property |
default |
description |
| producerFlowControl |
true |
the producer will slow down and eventually block if no resources(e.g. memory) are available on the broker. If this is off messages get off-lined to disk to prevent memory exhaustion |
| enableAudit |
true |
tracks duplicate messages (which can occur in failover for non-persistent messages |
| useCache |
true |
persistent messages are cached for fast retrieval from store |
| maxPageSize |
200 |
maximum number of persistent messages to page from store at a time |
| maxBrowsePageSize |
400 |
maximum number of persistent messages to page from store for a browser |
| minimumMessageSize |
1024 |
for non-serialized messages (embedded broker) - the assumed size of the message used for memory usage calculation. Serialized messages used the serialized size as the basis for the memory calculation |
| advisoryForConsumed |
false |
send an advisory message when a message is consumed by a client |
| advisoryForDelivered |
false |
send an advisory message when a message is sent to a client |
| advisoryForDiscardedMessages |
false |
send an advisory when a message is discarded |
| advisoryForSlowConsumers |
false |
send an advisory message if a consumer is deemed slow |
| advsioryForFastProducers |
false |
send an advisory message if a producer is deemed fast |
| advisoryWhenFull |
false |
send an advisory message when a limit (memory,store,temp disk) is full |
Additional properties for a Queue
| property |
default |
description |
| useConsumerPriority |
true |
use the priority of a consumer when dispatching messages from a Queue |
| strictOrderDispatch |
false |
ignore least loaded and always round robin dispatch |
| optimizedDispatch |
false |
don't use a separate thread for dispatching from a Queue |
| lazyDispatch |
false |
only page in from store the number of messages that can be dispatched at time |
| consumersBeforeDispatchStarts |
0 |
when the first consumer connects, wait for specified number of consumers before message dispatching starts |
| timeBeforeDispatchStarts |
0 |
when the first consumer connects, wait for specified time (in ms) before message dispatching starts |
The following are examples of different policies that can be customised on a per destination basis
Here is an example of this in use.
<beans>
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker persistent="false" brokerName="${brokername}" xmlns="http://activemq.apache.org/schema/core">
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic="FOO.>">
<dispatchPolicy>
<roundRobinDispatchPolicy />
</dispatchPolicy>
<subscriptionRecoveryPolicy>
<lastImageSubscriptionRecoveryPolicy />
</subscriptionRecoveryPolicy>
</policyEntry>
<policyEntry topic="ORDERS.>">
<dispatchPolicy>
<strictOrderDispatchPolicy />
</dispatchPolicy>
<subscriptionRecoveryPolicy>
<timedSubscriptionRecoveryPolicy recoverDuration="60000" />
</subscriptionRecoveryPolicy>
</policyEntry>
<policyEntry topic="PRICES.>">
<subscriptionRecoveryPolicy>
<timedSubscriptionRecoveryPolicy recoverDuration="10000" />
</subscriptionRecoveryPolicy>
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="10"/>
</pendingMessageLimitStrategy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
</broker>
</beans>