Skip to content

Receive properties are lost on delayed retries - #7901

Merged
danielmarbach merged 1 commit into
release-10.2from
backport-properties
Aug 5, 2026
Merged

Receive properties are lost on delayed retries#7901
danielmarbach merged 1 commit into
release-10.2from
backport-properties

Conversation

@danielmarbach

@danielmarbach danielmarbach commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Backport of:

Symptoms

When a message that carries native transport metadata via ReceiveProperties fails processing and is retried using delayed retries, the native receive properties are stripped. The metadata is present on the initial delivery but missing from the message once it is redelivered after the retry delay.

For example, a transport that relies on native metadata such as a message group id or deduplication id would see those values on the first delivery and then lose them on every subsequent delayed-retry delivery.

Who's affected

Only transport authors who adopt the new ReceiveProperties API (introduced in NServiceBus 10.2.0 via #7662) to carry native message metadata through the pipeline are affected.

End users of the Particular-supported transports are not affected, as no Particular transport currently uses the ReceiveProperties feature.

Root cause

Receive properties are propagated onto outgoing dispatch operations by RoutingToDispatchConnector, but only when it can locate an IncomingMessage with a matching message ID in the current context extensions.

During a delayed retry, the recoverability pipeline creates an OutgoingMessage with the original message ID and dispatches it back to the input queue through the routing/dispatch pipeline. The RecoverabilityContext already held the ReceiveProperties as a direct property, but it never published an IncomingMessage into its context extensions. Consequently, when RoutingToDispatchConnector looked one up during the delayed-retry dispatch, the lookup failed, the receive properties resolved to empty, and the redelivered message shipped without its native metadata.

The fix publishes the IncomingMessage (carrying the receive properties) into the recoverability context extensions, so the metadata flows through the routing context into the dispatch stage and survives the delayed retry (#7900).

* Preserve the native properties on delayed retries

* Slightly better assertions hopefully

* Align handler attribute usage with other tests since we forgot to change that

---------

Co-authored-by: Daniel Marbach <danielmarbach@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants