.net 什么是服务总线,我什么时候需要它?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2724816/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is a servicebus and when do I need one?
提问by stiank81
I have heard talk about the NServiceBus, but I haven't really understood what it is. They claim to be "The most popular open-source service bus for .net".
我听说过NServiceBus,但我还没有真正理解它是什么。他们声称是“最流行的 .net 开源服务总线”。
So; what is a "service bus", and when do I need one?
所以; 什么是“服务巴士”,我什么时候需要?
采纳答案by Udi Dahan
You can think of a service bus as the Ethernet of SOA.
您可以将服务总线视为 SOA 的以太网。
First and foremost, it introduces a language of identifying things, like an IP address in Ethernet. This name isn't something inherently physical.
首先,它引入了一种识别事物的语言,例如以太网中的 IP 地址。这个名字不是本质上的物理名称。
Next, you have something physical involved on each node, like a queue in the case of a bus for supporting semi-connected communication, or an Ethernet card in the metaphor.
接下来,每个节点都涉及一些物理内容,例如支持半连接通信的总线中的队列,或者比喻中的以太网卡。
Beyond just the physical, there is the "protocol" part of the communication, like the OSI stack for Ethernet. With the bus, this is the client libraries used by application code.
除了物理之外,还有通信的“协议”部分,例如以太网的 OSI 堆栈。对于总线,这是应用程序代码使用的客户端库。
Ultimately, you can view a service bus as providing the next higher level of abstraction for building distributed systems. You can use it also for client-server communication to give you durable one-way messaging as well as for the server to push notifications back to the client.
最终,您可以将服务总线视为为构建分布式系统提供下一个更高级别的抽象。您还可以将它用于客户端-服务器通信,以提供持久的单向消息传递以及服务器将通知推送回客户端。
Specifically, you'll find NServiceBus to be quite lightweight and easy to use once you make peace with its use of queuing technology - your choice of RabbitMQ, MSMQ, Regular SQL Tables, Amazon SQS, Azure Storage Queues, and Azure Service Bus.
具体来说,一旦您同意使用排队技术(您选择 RabbitMQ、MSMQ、常规 SQL 表、Amazon SQS、Azure 存储队列和 Azure 服务总线),您就会发现 NServiceBus 非常轻巧且易于使用。
回答by Justin Niessner
Check out the Wikipedia article for Enterprise Service Bus.
查看有关Enterprise Service Bus的 Wikipedia 文章。
A Service Bus acts as yet another layer of abstraction in the never ending quest to implement a good Service Oriented Architecture. The Service Bus can handle some of the heavy lifting seen behind a good Service Oriented Architecture like Messaging, Routing, and Service Co-Ordination.
在实现良好的面向服务的体系结构的永无止境的追求中,服务总线充当了另一个抽象层。服务总线可以处理良好的面向服务架构背后的一些繁重工作,例如消息传递、路由和服务协调。
If you're not sure why you'd want anything like that, I'd suggest reading up on what makes a good Service Oriented Architecture. The book that really opened my eyes and proved the different between just having Web Services and having a true Service Oriented Architecture was Thomas Erl's Service-Oriented Architecture: Concepts, Technology, and Design
如果你不确定你为什么想要这样的东西,我建议你阅读一下什么是好的面向服务的架构。真正让我大开眼界并证明拥有 Web 服务和拥有真正面向服务的架构之间的区别的书是 Thomas Erl 的面向服务的架构:概念、技术和设计
回答by stacker
This term was introduced with SOAwhich is in a way the successor (as buzz word) of EAI.
这个术语是在SOA中引入的,它在某种程度上是EAI的继承者(作为流行词)。
When you need it? That's a good question. It comes with a lot of complexity.
什么时候需要?这是个好问题。它带来了很多复杂性。
A rule of thumb could by if it solves more problems than it causes.
如果它解决的问题多于引起的问题,则可以采用经验法则。
To be serious if you have a heterogeneous environment and want align (different) applications (using different technology) with business processes. Then it could be helpful to use BPEL(but this introduces problems by migration) for orchestrationand choreography
如果您拥有异构环境并希望将(不同的)应用程序(使用不同的技术)与业务流程保持一致,请务必认真对待。那么使用BPEL(但这会通过迁移引入问题)进行编排和编排可能会有所帮助
EDIT: What's not on wikipedia, is practice: An ESB can i.g. adapt using special connectors, old terminal applications for use with Corba or Java Enterprise thats meant by interoperability. The drawback is the over 100 'Standards' around SOAP wich don't cooperate without enormous effort.
编辑:维基百科上没有的是实践:ESB 可以使用特殊的连接器、旧的终端应用程序进行调整,以与 Corba 或 Java Enterprise 一起使用,这意味着互操作性。缺点是围绕 SOAP 的 100 多个“标准”如果不付出巨大努力就无法合作。
You definitely need it if you have to interconnect IT systems within six month after a merger of 2 big assurance companies.
如果您必须在两家大型保险公司合并后的六个月内互连 IT 系统,您肯定需要它。

