如何使用Azure服务总线主题完成FIFO [英] How to accomplish FIFO with Azure service bus topics

查看:77
本文介绍了如何使用Azure服务总线主题完成FIFO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一直在寻找具有发布/订阅功能的消息总线.发现AWS SQS不支持FIFO,因此不得不放弃它.使用Azure Service总线,发现队列确实支持FIFO,但是主题似乎不支持FIFO.主题就是我们所需要的,具有其发布到多个子模型:(

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, found that queues do support FIFO, but it seems like Topics do not support FIFO. And topics are what we need, with their pub-to-many-sub model :(

这只是我所缺少的设置吗?我尝试从C#客户端发送100条消息,订阅者以错误的顺序收到消息.任何提示将不胜感激. 谢谢!

Is it just a setting I am missing? I tried sending 100 messages from my C# client, and the subscribers got the messages in the wrong order. Any tips would be appreciated. Thanks!

推荐答案

您应该可以通过将属性SupportOrdering设置为true来实现这一点

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);

这篇关于如何使用Azure服务总线主题完成FIFO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆