Set the Priority Queue
By default, all Release Bundle v2 version distributions have the same level of priority and are processed according to a first-in, first-out basis. JFrog Distribution 2.222.0 introduces the Priority Queue, which you can use to prioritize selected distribution and remote delete operations so that they are processed before other lower-priority tasks. There are three priority levels: low, medium (default), and high.
You can configure priority settings using the REST API.
Prerequisite
To set the priority queue, you must be a JFrog Distribution user with permissions to distribute or remotely delete Release Bundle v2 versions.
Set the Priority of a Distribution Task or Remote Delete Task
By default, all distribution and remote delete tasks have medium priority. Use the REST API to change the default, if required.
To set the priority of distribution or remote delete tasks:
- In the request body of the Distribution Release Bundle v2 Version API or Remote Delete v2 Version Distribution API, do one or both of the following:
- Set the
prioritytohigh,medium, orlow. This configures a uniform priority for the Release Bundle v2 version to all distribution targets. - Create one or more
distributionRulesto set the priority for specific targets, using eithersiteNameorcountryCodes. AdistributionRulessetting overrides thepriority. If multipledistributionRulesapply to the same target, the last one is applied.
- Set the
Sample Request Body
{
"priority": "medium",
"distributionRules": [
{ "siteName": "us-east-edge", "priority": "high" },
{ "siteName": "eu-west-edge" },
{ "countryCodes": ["DE", "FR"], "priority": "low" }
]
}Update the Priority of an Existing Task
Administrators can update the priority of a distribution task that has already been submitted using the REST API.
To change the priority of a distribution task:
- Use the Update Distribution Release Bundle Priority API.
PUT {JF_URL}/distribution/api/v2/distribution/trackers/{release_bundle_name}/{release_bundle_version}/{distribution_tracker}/priority - In the request body, do one or both of the following:
- Set the
prioritytohigh,medium, orlow. This configures a uniform priority for the Release Bundle v2 version to all distribution targets. - Create one or more
distributionRulesto set the priority for specific targets, using eithersiteNameorcountryCodes. AdistributionRulessetting overrides thepriority. If multipledistributionRulesapply to the same target, the last one is applied.
- Set the
Sample Priority Queue API Request Body
{
"priority": "high",
"distributionRules": [
{ "siteName": "eu-west-edge", "priority": "medium" },
{ "countryCodes": ["DE", "FR"], "priority": "low" }
]
}Sample Priority Queue API Response
{
"distributionTrackerId": 1042,
"distributionTrackerFriendlyId": 3,
"releaseBundleName": "my-bundle",
"releaseBundleVersion": "1.0.0",
"priority": "high",
"edges": [
{
"edgeNodeTrackerId": 2051,
"edgeNodeName": "eu-west-edge",
"status": "IN_PROGRESS",
"previousPriority": "medium",
"priority": "medium",
"result": "RECORDED"
},
{
"edgeNodeTrackerId": 2052,
"edgeNodeName": "eu-central-edge",
"status": "QUEUED",
"previousPriority": "medium",
"priority": "low",
"result": "APPLIED"
},
{
"edgeNodeTrackerId": 2054,
"edgeNodeName": "ap-south-edge",
"status": "COMPLETED",
"previousPriority": "medium",
"priority": "medium",
"result": "SKIPPED"
}Understanding the Result
The API response includes the result, which can be one of the following values:
APPLIED: The target status is eitherCREATEDorQUEUED. Therefore, the new priority defined bydistributionRulesapplies to every artifact task related to this Release Bundle v2 version distribution.RECORDED: The target status isIN_PROGRESSor later. The new priority is stored but used only if there is a retry. Otherwise, all artifact tasks for this distribution are queued at the previous priority level.SKIPPED: The target is already in its final state. The new priority value is not written.
Viewing the Priority
The priority of a distribution task can be seen in the response body of the Get Release Bundle v2 Distributions REST API.
Updated 1 day ago
