Queue Options (-QO)
Use the Queue Options adapter command (-QO) to assign listener options for members of a distributed queue.
-QO LstWt[, AccTm[, CplTm][, Tasks]]
- Option
- Description
- LstWt
- This is the listener weight, which is a value that determines the listener that receives a task from the scheduler. The member with the highest listener weight (largest numerical value) takes precedence.
- AccTm
- This is the listener accept time.
If non-zero, this is the length of time (in milliseconds) the scheduler waits for a listener member to accept an assigned task before reassigning the task.
If zero, there is no limit on the acceptance time. Therefore, the scheduler does not set a timer and does not reassign the task.
- CplTm
- This is the listener complete time.
If non-zero, this is the length of time (in milliseconds) the scheduler waits for a listener member to complete an assigned task before reassigning the task.
If zero, there is no limit on the completion time. Therefore, the scheduler does not set a timer and does not reassign the tasks.
- Tasks
- This is the maximum number of tasks a listener can accept.
When the scheduler receives a task, it assigns the task to the available listener with the greatest listener weight (LstWt). If LstWt is not defined, the default listener weight is 1.
If the accept time (AccTm) lapses before the scheduler receives acceptance from the listener member, the scheduler reassigns the task to another listener member. Zero is a special value (the default) that specifies no limit on the acceptance time. In this case, the scheduler does not set a timer and does not reassign tasks when the task has not been accepted. AccTm is specified in milliseconds and must be less than the complete time (unless complete time is zero). If AccTm is not specified, the default listener accept time is 0.
If complete time (CplTm) elapses before the scheduler is notified that the listener member has completed its task, the scheduler reassigns the task to another listener member. Zero is a special value (the default) that specifies no limit on the completion time, in which case the scheduler does not set a timer and does not reassign tasks when the task has not been completed. CplTm is specified in milliseconds and must be greater than the AccTm (unless complete time is zero). If CplTm is not specified, the default listener complete time is 0. AccTm is required before you can specify CplTm.
When the number of accepted tasks reaches the maximum set in listener tasks (Tasks), the listener cannot accept additional tasks until it completes one or more of them. When the scheduler receives a task, it assigns the task to the listener with the greatest LstWt unless the pending tasks assigned to that listener exceed its task capacity. When the preferred listener has too many tasks, the scheduler assigns the new inbound task to the listener with the next greatest LstWt. The value must be 1 or greater. If Tasks is not specified, the default listener tasks value is 1. AccTm and CplTm are required before you can specify Tasks.
The following example demonstrates how to implement a distributed queue named dq.local that listens for messages from the rv.msg subject using the following specifications:
- The scheduler weight is 5.
- This scheduler heartbeat is 2000 (2 seconds).
- The scheduler activation is 6000 (6 seconds).
- The listener weight is 50.
- The accept time is 5000 (5 seconds).
- The complete time is 10000 (10 seconds).
-SBN rv.msg -DQ dq.local, 5, 2000 6000 -QO 50, 5000, 10000
For assigning a correspondent name identifying data sources as members of a distributed queue and for setting scheduling parameters, see the Distributed Queue (-DQ) adapter command.