Skip to content

Proposed changes to ProcessingBehaviours, Projects and Repos #40

@srpeirce

Description

@srpeirce

Hi All,

Upon investigating the memory leak issue #37, I have some proposed changes to Pat.

I propose DefaultMessageProcessingBehaviour is no longer responsible for error handling, instead splitting this functionality into multiple separate behaviours to allow developer more control as to what happens when a subscriber fails to process a message.

RepublishFailedMessageWithDelayProcessingBehaviour
This will allow similar behaviour to existing peek lock timeout, except it will explicitly set the ScheduledEnqueueTime. This will need to manually increment the delivery count.

This will resolve the Memory Leak issue that we have at the moment where we do not complete a message (#37).

AbandonFailedMessageProcessingBehaviour
This is an alternative to RepublishFailedMessageWithDelayProcessingBehaviour whereby MessageReceiver.AbandonAsync will be called, this leads to message being put back onto the subscription and the delivery count will be incremented.
The message will be put back on the subscription and will be available to process by a subscriber without any delay.

https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.servicebus.core.messagereceiver.abandonasync?view=azure-dotnet

DeadletterFailedSerializationMessageProcessingBehaviour
This will be existing functionality extracted from DefaultMessageProcessingBehaviour whereby the message will be put on the DLQ when serialization fails.


For the RepublishFailedMessageWithDelayProcessingBehaviour we will need to send a message to ASB from Pat.Subscriber project, this is not something currently supported.

I propose that we achieve this by referencing Pat.Sender.

Rather than referencing via Nuget, I propose that we pull the Pat.Sender projects into this same repository and reference directly. This would mean Pat.Sender repository to be discontinued and Pat.Subscriber repository to be renamed.

Pat.Sender would still be a separate Nuget package for users who just need to send messages.

Subscribers would no longer need to explicitly reference Pat.Sender when they also send messages, meaning a simplified dev story.
This could lead to simplified configuration/logging story in the future.

With Pat.Subscribers project being able to send messages, potentially more advanced use cases would become available in the future…e.g. Sagas.

In this scenario I suggest that Pat.Subscriber and Pat.Sender version numbers would stay in sync.


Thoughts?

-Steve

Metadata

Metadata

Assignees

Labels

BigChange🤣Potentially a big change to projectquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions