Worker configuration
The use of the <worker> element in work-queue.xml is optional. However,
in actual practice, it is necessary for there to be at least one <worker> element for each
<work-queue> element
for the work queue to operate properly. The <worker> element contains
an instances attribute
that has a default value of 1. Without a <worker> element to provide
this default, the processing logic does not allocate any workers for
the work queue.
All of the following attributes are optional.
Attribute |
Description |
|---|---|
|
The number of workers to create. By default, PolicyCenter sets the values of this attribute to 1. If
a worker wakes up and detects work items, it checks out those work items
from the work queue. If there are more work items than the value specified
by the |
|
How often a worker
wakes up automatically and queries for work items, even if the worker
receives no notification. You might need to increase the value of |
|
The delay between
processing work items in milliseconds. The value controls how long the
process sleeps. A value of 0 (zero) means worker tasks process work items
as rapidly as possible. To reduce the CPU load, set the value of |
|
How many work items
the worker attempts to check out while searching for more work items.
Larger batch sizes are more efficient, but might not result in good load
distribution. The default value for |
|
The one or more environments in which this particular worker configuration is active. To specify multiple values for the env attribute, use a comma-separated list. |
|
The |
Example
workqueue. You define this work in a manner
similar to the following code:<worker server="#workqueue" instances="2"/>
In this case, the designation #workqueue (with the hash mark) indicates
a specific server role and not the server ID. The worker definition sets
instances to 2. This action creates two instances of the
designated worker on each application server with the workqueue
role.
See also
- For information about the definition
of the
envand theserveridvalues in the cluster registry in config.xml, see Understanding the configuration <registry> element.
