Using Queues

A JAMS Queue provides the ability to control the number of Jobs allowed to start at any given time as well as the ability to distribute (load balance) Jobs across zero or more Agents.

Queues can be assigned to Jobs and Folders. They can be stopped and then started to temporarily pause execution of Jobs that have not already started. When a Queue is started, Jobs waiting for it to become available will be started in the order of their scheduling priorities.

NOTE: Defining and using Queues in JAMS is optional.

Load Balancing

When multiple Agent names are assigned to a Queue, the JAMS Scheduler starts the next Job on the Agent with the fewest number of currently executing Jobs. JAMS V7 Windows Outgoing Agents that do not have the Connect On Demand Agent property checked are automatically removed from the load balanced pool of servers when the JAMS Scheduler detects they are unavailable. The Agents are automatically returned to the pool of servers when they become available again.

Queues and Resources

While Batch Queues and Resources are similar, there are significant differences listed below.

  • A Batch Queue is defined by the number of concurrent Job executions and/or different Agents that associated Jobs can be executed on.
  • When you submit a Job, a Batch Queue can be adjusted but a Resource cannot.
  • A Resource definition is based on the total number of unit quantities available. As these Jobs run, they consume the available units and they are released upon completion. Queues are defined by the maximum number of Jobs that they can run.
  • Unlike Queues, Resource requirements can be subtracted on specific Jobs to allow them to run as exceptions, even if no quantity of a Resource is available.
  • Unlike Queues, Resource requirements can be weighted to allow for throttling based on the different relative impact of Jobs on a system.
  • Resource requirements can be defined at the Folder and the Job level. These values are then added together to define the total units required for the Job to begin executing.
  • A Job can reference many different Resources, but only one Queue.
  • Jobs will always count as 1 against the Queue Job limit, regardless of the Job type.

Batch Queue Screen

The Batch Queue screen lets you view, create, modify, or delete Queues. Each Queue displays the following:

  • Batch Queue Name – The name of Batch Queue.
  • Started – A check mark indicates the Batch Queue has started and any Jobs that are submitted to the Queue are available to run.
  • Job Limit – The maximum number of Jobs that will run concurrently. A Sequence Job is treated as one Job. For Sequence Jobs, the child Jobs can run on the same Queue or a different Queue.
  • Description – An optional description of the Queue.

The current Job Count can also be added as a column using the Column Chooser tool. Right-click any column heading, and select Column Chooser.

Viewing all Queues

  1. Click Queues from the Shortcuts menu.
  2. Click a column heading to sort the list.

Creating a Queue

  1. Click Queues from the Shortcuts menu.
  2. Click Add.
  3. In the Name field, enter a name for the Queue.
  4. In the Job Limit field, enter the maximum number of Jobs that can run concurrently.
  5. Click Ok.
  6. Click the Status tab.
  7. In the Started On section, click the row to add Agent names (optional). If no Agent name is specified and the Job Definition does not have/inherit an Agent, Jobs execute locally on the JAMS Scheduler. If multiple Agent Names are specified, Jobs are distributed (load balanced) between the available Agent Names.
  8. Click Save and Close.

Applying a Queue to a Job or Folder

You can apply a Queue to a Job or a Folder. If you apply the Queue at the Folder, all Jobs within the Folder will have the same Queue applied.

  1. Click Definitions from the Shortcuts menu.
  2. Right-click a Job or a Folder, and select Properties.
  3. Click the Properties tab.
  4. In the Batch Queue field, select the name of the Batch Queue.
  5. Click Save and Close.

Removing a Queue from a Job or Folder

You can remove a Queue from a Job or a Folder.

  1. Click Definitions from the Shortcuts menu.
  2. Right-click a Job or a Folder, and select Properties.
  3. Click the Properties tab.
  4. Right-click the Batch Queue field, and select Reset.
  5. Click Save and Close.

Modifying a Queue

You can modify the properties of the Queue as well as its status, the maximum number of Jobs it can run, and the Agent it runs on.

  1. Click Queues from the Shortcuts menu.
  2. Double-click the Queue that you want to edit.
  3. Click the Name tab to modify the following:
    1. Name
    2. Description.
  4. Click the Status tab to modify the following:
    1. Under Status, select the checkbox to start or stop the Queue. If the checkbox is selected, Jobs submitted to the Queue are available to run.
    2. In the Job Limit field, enter the maximum number of Jobs that can run concurrently.
    3. In the Started On section, add, delete or modify the Agent names which Jobs will be start on. See the section below for details.
  5. Click Save and Close.

Deleting a Queue

You can delete a Queue if it is no longer used. Before deleting a Queue, ensure all Jobs and Folders that currently use it have been updated to remove references to it. To view where it is referenced, double-click the Queue and select the References tab.

  1. Click Queues from the Shortcuts menu.

  2. Right-click a Queue, and select Delete.

  3. When you are prompted to confirm the deletion, click Yes.

Agents in Batch Queues

Selecting an Agent in a Batch Queue is optional. If no Agent is specified in the Batch Queue and the Job definition does not have/inherit an Agent, the Job executes locally on the JAMS Scheduler. If multiple Agent names are specified, Jobs are distributed (load balanced) between the available Agent names.

An Agent name in a Job definition overrides an Agent name in a Queue definition. However, the Job still runs on the assigned Queue and adheres to any Job Limit settings defined within the Queue.

Adding an Agent to a Queue

You can add more than one Agent to a Batch Queue.

  1. Click Queues from the Shortcuts menu.
  2. Double-click the Queue that you want to edit.
  3. Click the Status tab.
  4. Under Started On, click in the row to select an Agent.
  5. Click Save and Close.

Deleting an Agent from a Queue

  1. Click Queues from the Shortcuts menu.
  2. Double-click the Queue that you want to edit.
  3. Click the Status tab.
  4. Under Started On, click in the row to select an Agent to remove.
  5. Press the Delete key.
  6. Click OK.
  7. Click Save and Close.

Manually Stopping and Starting a Queue

You can manually start or stop a Queue to prevent or allow Jobs to run. This is useful when you are performing maintenance on Agents that may cause Jobs to not perform as expected.

  1. Click Queues from the Shortcuts menu.
  2. Click the Queue that you want to start or stop.
  3. Click Start or Stop. The Started column is updated.

Stopping or Starting a Queue using PowerShell

If you are using a Queue rather than a Resource to create a maintenance window in JAMS, you can start or stop the Queue by creating a PowerShell Job.

  1. Click Definitions from the Shortcuts menu.
  2. Select a Folder to save the Job.
  3. Click +.
  4. In the Name field, enter a name for the Job.
  5. In the Execution Method field, select PowerShell.
  6. Click Ok.
  7. In the Source tab, enter the text below and replace “Q0001” with the name of the Queue.
    Copy
    $QueueName = "Q0001"
    $JAMSDefaultServer = "localhost"
    Stop-JAMSQueue $QueueName
    #
    Start-JAMSQueue $QueueName
  8. Click the Properties tab.
  9. In the Execute As field, select a Credential to run the Job.
  10. Click Save and Close.

Batch Queue Properties

Name Tab

Option Description
Batch Queue Name This property is the name for the Batch Queue that is displayed in JAMS objects, such as Jobs or Agents.
Description This property is an optional summary of the Batch Queue.
Last Change This property is the date and time the Batch Queue was added or changed.

Status Tab

Option Description
Started The Started checkbox lets you start or stop a Batch Queue from being used.
Job Limit This property lets you set the maximum number of Jobs that will run concurrently.
Started On This section lets you add one or more Agents to the Batch Queue.

Security Tab

Option Description
Security The Security tab defines the level of access for this Batch Queue. This is an Access Control List with one-to-many Access Control Entries (ACE). You can add or delete an ACE. Each ACE can specify the following rights:
  • Change: users can modify this Queue (including Start/Stop) if they have Change access in Queue Definitions.
  • Control: users can modify the Queue's Access Control List.
  • Delete: users can delete the Queue if they have Delete access for Queue Definitions.
  • Inquire: users can inquire into the Queue if they have Inquire access to Queue Definitions.
  • Manage: not used.
  • Submit: users can associate the Queue with Folder/Job Definitions.

References Tab

Option Description
References The References tab lets you view where the Batch Queue is used within JAMS.

Related Topics