How to accomplish FIFO with Azure service bus topics

后端 未结 2 956
粉色の甜心
粉色の甜心 2020-12-20 22:11

Have been looking for a Message bus with publish/subscribe functionality. Found that AWS SQS does not support FIFO, so had to give up on it. Working with Azure Service bus,

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-20 22:35

    You should be able to achieve this by setting property SupportOrdering to true

        // Configure Topic Settings
        TopicDescription td = new TopicDescription("TestTopic");
        td.SupportOrdering = true;
    
        // Create a new Topic with custom settings
        string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
    
        var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
        namespaceManager.CreateTopic(td);
    

提交回复
热议问题