This article explains creating and managing queues for use with Spark Messaging. You can learn more about Spark Messaging in the Developer Portal.
Accessing Spark Queue Administration
View and manage queues from Admin > Connections > Spark Queues. You must have a security profile that grants the Admin: Queues permissions to work with queues.
How to Create Spark Queues
To create a new queue:
- From the Spark Queues page, click Create.
- Enter a Label for this queue. This is the label which appears for Admins in the Vault UI.
- Vault automatically populates the Name field. This is the name for the queue when called from Vault Java SDK code. Only lowercase, alphanumeric characters and a single underscore (_) between characters are allowed.
- Select a Status for this queue. Only Active queues can accept messages.
- Optional: Enter a Description for this queue.
- Select a Queue Type. If you want this queue to send messages, select Outbound. If you want this queue to receive messages, select Inbound.
- If your Queue Type is Inbound, select a Spark Message Processor. These are custom Vault extensions created with the Vault Java SDK designed to process messages. You can view details about the Spark message processors available in your Vault in Admin > Connections > Spark Message Processors.
- If your Queue Type is Inbound, select a Spark Message Processor User. This is the user who will process messages delivered to this queue.
- Optional: If your Queue Type is Outbound, select a Spark Message Delivery Event Handler and Spark Message Delivery Handler User. Learn about Spark Message Delivery Event Handlers in the Developer Portal.
- Optional: If the messages intended for this queue must be processed sequentially, meaning one after another in the order they are received, select Sequential Message Processing. This is generally not recommended as it will cause messages to accumulate in the queue and slow down delivery.
- Optional: If you want this queue to continue the transaction when a message fails to enter the queue, deselect Rollback on Error. Otherwise, failure to put a message into this queue will rollback the entire transaction.
- Click Save.
After creating a queue, you may want to add a Queue Connection. Learn more about creating connections.
Managing Queue Connections
If your queue is attached to a connection, it will appear under the Queue Connections section on the queue’s Details page. This section shows you various details related to your queue connections, such as Connection Type, URL, and Connection Name.
From the Details page, you can Create more queue connections or View, Edit, and Delete existing connections on this queue from the Actions menu.
How to Inactivate a Spark Queue
If you want a Spark 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 an outbound queue had messages in it prior to inactivating the queue, those messages are still sent. If you want to stop sending messages already in the queue, you must disable delivery.
To inactivate a queue:
- In the queue Details page, click Edit.
- Set the Status to Inactive.
- Click Save.
An inactive queue will immediately stop accepting messages. If you want to re-activate this queue, you can do so with the same process. Once a queue is Active, it will start accepting messages again.
How to Disable Delivery
If you want an outbound Spark queue to stop delivering existing messages, you must disable the queue. This prevents any messages from exiting the queue, but 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:
- Navigate to the outbound queue where you wish to disable delivery.
- From the Actions menu, select Disable Delivery.
- 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 again, you can enable the queue with the same process.
This option is not available for inbound queues, as inbound queues process received messages rather than deliver messages. There is no way to stop an inbound queue from processing existing messages. If you have an inbound queue with existing messages you do not want processed, you must reset the queue.
How to Delete All Messages in a Spark 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 send or receive messages, but any messages in the queue remain. If you no longer want these messages, you can reset the queue.
This action is permanent and cannot be undone.
To reset a queue:
- Navigate to the queue where you wish to reset.
- Click Reset Queue.
- After reading the warning, click Continue.
- When the process is complete, you will receive a green banner notification that Vault successfully reset the queue.