Skip to content

[Question] How to deal with integration events and horizontal scaling of the Blazor Web App? #9

@dumyshydra

Description

@dumyshydra

Hello!

Currently, Blazor Web App stores all the subscription callbacks that need to be fired when an integration event is handled in a dictionary which has the buyer ID as the key. Integration events contain the buyer ID in the payload that is then used to correctly trigger the corresponding callback.

But if we scale out the Blazor Web App to two instances after the Azure deployment, some integration events might not be properly handled because of the Azure Service Bus implementing the competing consumers pattern.

Example:

Blazor Web App instance A --stores---> subscription callback for buyer ID 1
Blazor Web App instance B --stores---> subscription callback for buyer ID 2

Both instances are using the same topic subscription to receive messages.

An OrderStatusChangedToCancelledIntegrationEvent is published to the Azure Service Bus topic for buyer ID 1, but the message is processed by Blazor Web App instance B. No callback will be called because Blazor Web App instance B doesn't have any subscription registered for buyer ID 1.

How to handle this scenario?

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions