Work queues and server roles

In the base configuration, Guidewire assigns work queue functionality to servers with the workqueue role. File work-queue.xml associates the workequeue server role with the application work queue functionality.

Note: The hash mark in front of workqueue (#workqueue) indicates that the value that follows the hash mark is a server role and not a server ID.

The workqueue role is merely the default role, however. You are free to create and assign new work queue management roles. You can also use server roles to enable or disable certain work queues on a specific PolicyCenter server.

Defining a new work queue role

You define server roles using the roles attribute on the <registry> element in file config.xml. In the base configuration, Guidewire defines the following server roles:
  • <registry roles="batch, workqueue, scheduler, messaging, startable, ui" />
To add a specialized work queue role, say, one to use in managing activity work queues (activitywq), add the new server role to the list of roles:
  • <registry roles="batch, workqueue, activitywq, scheduler, messaging, startable, ui" />

Assigning a work queue to specific PolicyCenter cluster servers

Suppose that you want to assign the management of the activity work queues in the PolicyCenter cluster to a subset of the cluster servers with the activityworkqueue role. By default, PolicyCenter distributes all other work queues to those servers with the default workqueue role.

For example, in file work-queue.xml, you define the following:

<?xml version="1.0"?>
<work-queues xmlns="http://guidewire.com/work-queue" defaultServer="#workqueue">
  <work-queue workQueueClass="com.guidewire.pl.domain.escalation.ActivityEscalationWorkQueue" … >
    <worker server="#activityworkqueue"/>
  </work-queue>
  <work-queue workQueueClass="com.guidewire.pl.domain.geodata.geocode.GeocodeWorkQueue" … >
    <worker/>
  </work-queue>
</work-queues>

In this example:

  1. If a server has the workqueue role only, then that server:
    1. Starts an executor for the GeocodeWorkQueue work queue.
    2. Does not start an executor for the ActivityEscalationWorkQueue work queue.
  2. If a server has the activityworkqueue role only, then that server:
    1. Starts an executor for ActivityEscalationWorkQueue work queue.
    2. Does not start an executor for the GeocodeWorkQueue work queue.
  3. If a server has both the activityworkqueue and workqueue roles, then that server starts executors for both work queues.
  4. If a server has neither the activityworkqueue nor the workqueue role, then the server does not start an executor for either of these work queues.