# Creating & Managing SDK Job Queues

This article explains creating and managing queues for use with custom jobs created with the Vault Java SDK. You can learn more about the <a class="external-link " href="https://developer.veevavault.com/sdk" target="_blank" rel="noopener">Vault Java SDK in the Developer Portal<i class="fa fa-external-link" aria-hidden="true"></i></a>.

SDK job queues allow you to process messages (also known as tasks) in a custom queue rather than processing all messages in one System queue. This can be helpful for performance, and for enabling or disabling specific queues rather than all queues at once.

## Accessing SDK Job Queue Administration

View and manage queues from **Admin** > **Operations** > **SDK Job Queues**. You must have a security profile that grants the _Admin: SDK Job Queues_ permissions to work with queues.

## How to Create SDK Job Queues

To create a new queue:

  1. From the **SDK Job Queues** page, click **Create**.
  2. Enter a **Label** for this queue. This is the label which appears for Admins in the Vault UI.
  3. Vault automatically populates the **Name** field. This is the name for the queue when called from Vault Java SDK code. If desired, you can modify this name. Only lowercase, alphanumeric characters and a single underscore (\_) between characters are allowed.
  4. Select a **Status** for this queue. Only _Active_ queues can receive messages.
  5. Optional: Enter a **Description** for this queue.
  6. Click **Save**.

After creating an SDK job queue, you may want to add it to SDK Job Metadata.

## How to Inactivate an SDK Job Queue

If you want an SDK job queue to stop receiving messages, you must set the queue _Status_ to _Inactive_. Once inactive, a queue cannot accept any new messages.

This does not prevent a queue from processing messages which are already in the queue. For example, if a queue had messages in it prior to inactivating the queue, those messages are still processed. If you want to stop processing the messages already in the queue, you must [disable delivery][1].

To inactivate a queue:

  1. In the queue _Details_ page, click **Edit**.
  2. Set the **Status** to _Inactive_.
  3. Click **Save**.

An inactive queue immediately stops accepting messages. If you want to re-activate a queue, you can do so with the same process. Once a queue is _Active_, it starts accepting messages again.

## How to Disable Delivery {#Disable_Delivery}

If you want an SDK job queue to stop delivering existing messages to the job processor, you must disable delivery. This does not prevent new messages from entering the queue. For example, an _Active_ queue with a _Delivery Status_ set to _Disabled_ will still allow new messages to enter the queue, but no messages will exit the queue.

To disable a queue:

  1. Navigate to the SDK job queue where you wish to disable delivery.
  2. From the **All Actions** menu, select **Disable Delivery**.
  3. The queue is now disabled. In the queue details, the _Delivery Status_ now shows as **Disabled**.

If you want this queue to begin delivering messages to the processor again, you can enable the queue with the same process.

## How to Delete All Messages in an SDK Job Queue

Changing the _Status_ or _Delivery Status_ of a queue does not delete any messages in the queue. For example, an _Inactive_ queue with a _Delivery Status_ set to _Disabled_ cannot receive or process messages, but any messages in the queue remain. If you no longer want these messages, you can reset the queue.

Resetting a queue is permanent and cannot be undone.

To reset a queue:

  1. Navigate to the _Details_ page of the SDK Job queue you wish to reset.
  2. Click **Reset Queue**.
  3. After reading the warning, click **Continue**.
  4. When the process is complete, you will receive a green banner notification that Vault successfully reset the queue.

[1]: #Disable_Delivery