Skip to content

feat(postgres): add priority queueing for commands - #237

Draft
elmaxe wants to merge 1 commit into
masterfrom
feature/postgres-priority-queueing
Draft

feat(postgres): add priority queueing for commands#237
elmaxe wants to merge 1 commit into
masterfrom
feature/postgres-priority-queueing

Conversation

@elmaxe

@elmaxe elmaxe commented Aug 27, 2026

Copy link
Copy Markdown
Member

Messages can implement IPriority (KnightBus.Messages) to declare an int Priority; the PostgreSql transport locks/fetches higher-priority messages first, tie-broken by message_id asc to preserve FIFO within a priority.

Schema init now runs eagerly on every receiver startup (not just when a table is missing) so already-deployed queues pick up the new priority column automatically. Scoped to commands (Send/Schedule) for now; Publish (events) is unaffected.

What this changes

Notes for the reviewer

Checklist

  • dotnet build KnightBus.slnx and dotnet test pass
  • dotnet csharpier check . passes (CI fails on unformatted code)
  • Tests cover the change
  • Documentation under docs/ is updated, if the change is user-visible
  • <Version> is bumped in the affected .csproj and CHANGELOG.md has an entry, if this
    should be released

Messages can implement IPriority (KnightBus.Messages) to declare an int
Priority; the PostgreSql transport locks/fetches higher-priority messages
first, tie-broken by message_id asc to preserve FIFO within a priority.

Schema init now runs eagerly on every receiver startup (not just when a
table is missing) so already-deployed queues pick up the new priority
column automatically. Scoped to commands (Send/Schedule) for now; Publish
(events) is unaffected.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant