Appearance
Priority queue
Queue that emits records ordered by an integer priority property instead of arrival order. Input records are stored and the call returns at once; a background worker emits them one by one on Output. Optionally persistable and duplicate-filtering, like the Reqular queue.
Pins
| Pin | Kind | Types | Description |
|---|---|---|---|
| Input | input | any | Record to queue. |
| Clear | input | any | Any record; removes all queued records. The record content is not used. |
| Output | output | same as input | Queued records in priority order, one at a time, each with new metadata. |
| Already exists | continue | any | Records rejected as duplicates (same FilterProperty value within FilterLifetimeInMsec), with their original metadata. |
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
Name | string (max 128) | mypqueue | Required. Queue name; Queue writer components in the same flow write into the queue by this name. |
PriorityProperty | dropdown (integer property of the input type) | Required. Property holding the priority. Lower value = emitted first. Options appear after the input is connected. | |
MaxItemsInQueue | integer (≥ 0) | 0 | Capacity, 0 = unlimited. Also bounds the duplicate filter. |
FilterProperty | dropdown (property of the input type) | Optional. Property whose value is the duplicate key. | |
FilterLifetimeInMsec | integer (≥ 0) | 0 | How long a key is remembered after its record was queued, in milliseconds. 0 = no time limit. |
Persistable | boolean | false | true keeps queued records and filter keys on disk and restores them when the flow starts again. |
ItemLifetimeInSec | integer (≥ 0) | 0 | Records older than this (since they were queued) are dropped with a warning. 0 = never. |
Behaviour
- At start the queue is created under
Namefor this flow and one worker starts. WithoutPriorityPropertythe flow fails to start. The item type is the type of theInputconnection (or ofOutputwhen only Queue writers feed the queue). Input: the priority is read fromPriorityPropertyand the record is added; the call returns (warm-up calls are ignored). Full queue: dropped with a warning. Duplicate:Already exists.- Worker: always takes the record with the smallest priority value; equal priorities leave in arrival order. Expired records are skipped. The next record is taken only after the
Outputcall returns, so a record queued later with a smaller value overtakes everything still waiting. - Delivery is retried if the
Outputbranch throws: again after 100 ms, doubling up to 30 s, until it succeeds, expires, the queue is cleared or the flow stops. Nothing is delivered while the flow is paused. - Duplicates,
Clear, persistence and queue naming work as in the Reqular queue: keys stay forFilterLifetimeInMsecalso after the record left the queue;Clearempties records and keys (also on disk); a persistable queue restores its records (with their priorities) on start and discards them if the item type changed.
Notes
- Priority order is ascending:
0before1before10. Use negative values or invert your scale if "higher number = more important". - Records leave the queue with new metadata.
- A record that always fails blocks the queue until it expires: set
ItemLifetimeInSecor handle errors in theOutputbranch. - A record whose priority property can't be read as an integer fails on
Input.
Example
json
{ "Name": "jobs", "PriorityProperty": "Priority", "MaxItemsInQueue": 0, "FilterProperty": "JobId", "Persistable": true }Http listener → Priority queue → (process job) → ...