Opening and Closing a Queue
Closing a Queue means that Jobs will not queue up and wait, if a trigger occurs after the Queue is closed. Therefore, it would be considered a "missed" trigger in that the Scheduler will not place the Jobs in a waiting state, which happens when a Queue is stopped. Therefore, closing a Queue is a more severe action because Jobs will not queue up or run during the closed period. However there may be scenarios that you do not wish Jobs to queue up when a Queue is down for maintenance purposes. When that is the case, you can close the Queue.
When an
is closed, this means Jobs will not run or queue up when they are directly associated to the Execution Queue that is being closed. For example, if a manual trigger is performed, an ActiveBatch Error message box will pop up, stating that the Queue is closed for submissions. If the Queue is closed and an automated trigger occurs, the instance will be marked "failed" (it will not run) with an exit code description of "Queue closed". If Job(s) are already executing when you close an Execution Queue, they will not be impacted and will continue to run to completion.
When a
is closed, Jobs that are triggered and associated with that Queue will not be dispatched to any member Execution Queue(s). For example, if a manual trigger is performed, an ActiveBatch Error message box will pop up, stating that the Queue is closed for submissions. If the Queue is closed and an automated trigger occurs, the instance will be marked "failed" (it will not run) with an exit code description of "Queue closed". If Job(s) are already executing when you close a Generic Queue, they will not be impacted and will run to completion.
One of the advantages of associating Jobs to a Generic Queue is if one of the member Execution Queues are closed, the remaining member systems are still eligible to run the Job when it triggers.
Open/Close operation is an in-context operation. That means ActiveBatch will select the proper operation depending on the current state of the Queue (i.e. if it’s open, you can close the Queue).
You can also automatically schedule a close operation for a period of time, on a per Queue basis, as part of the Queue’s properties. See the image below (see Auto Close/Stop). One drawback to the timed Queue operations is that, once set they are applied each day.
However, the Close and Open Queue Jobs Library Job Steps are also available for maximum flexibility - meaning you could use the steps to perform the actions on a schedule, instead of using the Auto Close/Stop properties depicted in the image above.
Below is the CloseQueue Jobs Library Job Step. A complementary Job could be scheduled at a later time to open the Queue using the OpenQueue Jobs Library Step.
While the Queue in this example is hard-coded (the full path to Server1), you could use a variable. That would make the set of Jobs generic and applicable for use everywhere in your system. The Job Scheduler property is identified using a built-in variable ${@JobScheduler}. This is recommended when you have a high availability solution for the Job Scheduler. The variable will resolve to the Scheduler that is currently up and running.
To close or open a Queue, you must have “Manage” access permission on the Queue object.