masstransitazure-servicebus-topicsazure-servicebus-subscriptions

MassTransit with Azure Service Bus topic subscription


I have a consumer in MassTransit and it seems like it wants to listen for messages on a queue as default. It creates a topic with a subscription, and a queue. Messages are forwarded from the subscription to the queue.

How can I configure it to work directly with the subscription?


Solution

  • If you only want to use a subscription, you will need to manually configure the subscription.

    cfg.SubscriptionEndpoint<MessageType>("subscription-name", e =>
    {
        e.ConfigureConsumer<MyConsumer>(context);
    })