Skip to content

fix: rabbitmq jobQueue expiration parameter format#25113

Merged
maliming merged 4 commits into
abpframework:devfrom
scrapstation:dev
Mar 19, 2026
Merged

fix: rabbitmq jobQueue expiration parameter format#25113
maliming merged 4 commits into
abpframework:devfrom
scrapstation:dev

Conversation

@scrapstation

Copy link
Copy Markdown
Contributor

Problem

TimeSpan.TotalMilliseconds is a double (e.g., 1.23), while the Expiration parameter of RabbitMQ requires a non-negative integer.

This may cause the message to not be published as expected.

https://www.rabbitmq.com/docs/3.13/ttl#per-message-ttl-in-publishers

Fix

Convert TimeSpan.TotalMilliseconds to a long value.

@CLAassistant

CLAassistant commented Mar 18, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@scrapstation

Copy link
Copy Markdown
Contributor Author

@maliming pls review

@maliming maliming requested a review from Copilot March 19, 2026 00:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes RabbitMQ per-message TTL formatting for delayed background jobs by ensuring the basicProperties.Expiration value is emitted as an integer millisecond string (RabbitMQ requires a non-negative integer string, not a floating-point representation).

Changes:

  • Convert TimeSpan.TotalMilliseconds (double) to an integer millisecond value when setting RabbitMQ message Expiration.

@maliming maliming requested a review from Copilot March 19, 2026 01:23
@maliming maliming added this to the 10.3-preview milestone Mar 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes RabbitMQ per-message TTL formatting for delayed background job messages by ensuring the Expiration property is set as an integer millisecond value (RabbitMQ requires a non-negative integer string).

Changes:

  • Convert TimeSpan.TotalMilliseconds (double) into an integer millisecond string for basicProperties.Expiration.
  • Round up fractional milliseconds to avoid shortening the intended delay.

@maliming maliming requested a review from Copilot March 19, 2026 01:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes RabbitMQ per-message TTL (basicProperties.Expiration) formatting in the RabbitMQ background job queue publisher by ensuring the value is a non-negative integer string (RabbitMQ requires an integer, not a floating-point value).

Changes:

  • Convert TimeSpan.TotalMilliseconds (double) to a non-negative integer millisecond string using ceiling + long casting before publishing delayed jobs.

@maliming maliming merged commit 218aa0f into abpframework:dev Mar 19, 2026
1 of 2 checks passed
@maliming

Copy link
Copy Markdown
Member

Thank you for your contribution 👍

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.

4 participants