Skip to content

Contention issue on initial startup with multiple subscribers #2

@grumpydev

Description

@grumpydev

I have multiple workers that subscribe with the following code:

            this._bus.SubscribeAsync<Message>(this.OnMessageReceived,
                config =>
                    {
                        config.WithSubscription(this._configuration["SubscriptionId"]);
                        config.WithTopic(this._configuration["Topic"]);
                    });

When I fire the workers up for the first time they all hit "TopicDeclare" and try and create the topic, which makes two of them crash with Conflict errors:

image

They start up again fine, as the next time they run they can see the topic already there so don't try and create it.

I guess the topic creation needs some code to handle conflicts and back off for a period then re-check if the topic exists?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions