-
1. Re: policyEntry element
chirino_hchirino Nov 14, 2007 5:45 PM (in response to emjohnson)Most configuration options can be configured either as an element or an attribute. For simple values like strings, booleans, and numbers, configuring the value using the attribute is more compact than using the element notation. For example:
<broker brokerName="localhost"> </broker>
is equivalent to:
<broker> <brokerName>localhost</brokerName> </broker>
But you never see us use the second form since the first is so much more compact. In other cases where the configured value is a complex object and not a simple value, the complex object can be specified using a bean reference or it can be defined inline using the element notation. It usually easier to configure the object inline using the element notation versus using a object reference, so this is what we usually do. For example:
<policyEntry topic="FOO.>"> <pendingQueuePolicy> <fileQueueCursor></fileQueueCursor> </pendingQueuePolicy> </policyEntry>
Would configure the pendingQueuePolicy property with the inline element but the same can be done using:
<policyEntry topic="FOO.>" pendingQueuePolicy="#policy-a"> </policyEntry>
and then outside the broker element defining a:
<fileQueueCursor id="policy-a" xmlns="http://activemq.org/config/1.0"/>
or even a:
<bean id="policy-a" class="org.apache.activemq.broker.region.policy.FilePendingQueueMessageStoragePolicy"/>
But as you saw, the first approach is much more compact way of doing it.
Regards,
Hiram
Edited by: chirino on Nov 14, 2007 5:45 PM