WCF 与服务总线
我们的工作陷入困境,我需要澄清一下:
基本上:我们可以使用 WCF 读取/写入 MSMQ 并获取类型 我们经过的物体的安全。
替代方案:我们可以使用 NService Bus 之类的东西来完成 完全相同的事情。
现在,在我的工作中,我们都精通 WCF,但没有人精通使用服务总线。
那么有人可以帮助我了解使用 WCF 或 NService Bus 的一些优点/缺点收益/损失吗,因为现在在我看来,使用 WCF 会更容易(只要我们不需要高级事务等)?
您估计以后从 WCF 更改为 NService 总线有多容易?
亲切的问候
We're in a tight spot at work and I need some clarity:
Basically: We can use WCF to read/write to an MSMQ and get type
safety on the objects we pass.Alternative: We could use something like NService Bus to do the
exact same thing.
Now at my work we're all well versed in WCF, but none of us are well versed in using a Service Bus.
So could someone please help me with some pros/cons gains/losses for using WCF or NService Bus as right now it looks to me that it would be easier to use WCF (as long as we don't need advanced transactions etc)?
How easy would you estimate it would be to later change from WCF to NService Bus?
Kind regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您只想将消息推送到 MSMQ,那么您也不需要。
NServiceBus 不只是将消息排队。对于您编写的每个 NServiceBus 服务,您可以指定它订阅和发布哪些消息。然后,NServiceBus 使用 MSMQ 作为传输机制来负责消息的调度和传递。
NServiceBus 使应用程序可以轻松地发布和订阅消息,而无需知道消息来自哪里,或者服务何时移动到另一台服务器。
然而,NServiceBus 并不像您想象的那么容易使用,没有很多好的文档可用。因此,需要一些时间来克服它。
从 v2.5 开始,如果您想在多个线程上使用它,您需要商业许可证。
If all you want to do is push messages into MSMQ, you don't need either.
NServiceBus doesn't just enqueue messages. Per NServiceBus service that you write, you can specify to which messages it subscribes and which it publishes. NServiceBus then takes care of the dispatching and delivering of the messages, using MSMQ as the transport mechanism.
NServiceBus makes it easy this way for applications to just publish and subscribe to messages without requiring knowledge of where they come from, or when a service has moved to another server.
However, NServiceBus is not as easy to use as you might think, there is not a lot of good documentation available. It thus takes some time to plough through it.
And since v2.5, you need a commercial license if you want to use it on more than one thread.
正如其他人提到的,我不会使用 NServiceBus 作为简单地将消息放入队列的方法。正如 Roy 所说,NServiceBus 的实现并不简单。这是一种架构选择,而不仅仅是一种实现选择。
然而,当我的团队从 WCF 解决方案迁移到 NServiceBus 时,我们非常高兴(在学习曲线之后)。优点之一是系统的设计使人们更难做错事。也就是说,如果在 NServiceBus 中很难做某件事,那么您可能没有按照应有的方式考虑架构(如果您想要一个异步、可扩展、可维护的系统)。
As others have mentioned, I wouldn't use NServiceBus as a way to simply get messages onto a queue. As Roy says, NServiceBus is not trivial to implement. It's an architectural choice, not simply an implementation choice.
However, when my team moved from a WCF solution to NServiceBus, we were very happy (after the learning curve). One of the advantages is that the design of the system makes it harder to do the wrong thing. That is to say, if something is hard to do in NServiceBus, then you are probably not thinking about the architecture the way you should (if you want an asynchronous, scalable, maintainable system).