架构帮助(WCF 或非 WCF)
我需要处理来自不同(客户端)Web 应用程序的数千个用户详细信息。我已经完成了一个执行实际处理的控制台应用程序。我还决定使用 MSMQ(控制台应用程序将从队列中获取用户详细信息)。
我需要帮助来决定客户端 Web 应用程序如何将数据传递到队列。我想我可以添加一个 WCF 服务,该服务将从客户端应用程序接收数据并将其传递到队列。
这是最好的方法吗?或者有更好的方法吗?
I need to process thousands of user details from different (clients) web applications. I have finished a console app that does the actual processing. I have also decided to use MSMQ (the console app will get the user details from a Queue).
I need help deciding how the client web applications will pass data to the Queue. I am thinking I can add a WCF service that will receive data from the client apps and pass it on to the Queue.
Would this be the best way to go? Or is there a better way(s)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果整个架构是基于 Microsoft 的,我可以建议您使用 InProc dll 将消息推送到 MSMQ,这比通过 WCF 访问要快得多(这为架构添加了一层,并且由于需要序列化/反序列化而减慢了进程) )的对象。如果您以正确的方式(SOLID原则)设计此组件并且使其不与代码耦合,您可以轻松切换到WCF(如果需要)添加数据契约和端点以将您的组件公开为服务(最终 WCF 公开了一个接口)
If the whole architecture is Microsoft based I can suggest you to push messages to MSMQ using an InProc dll which is much faster than access via WCF (which add one more layer to the architecture and it slow down the process as it need to serialize/deserialize) the objects. If you design this component in a proper way (SOLID principles) and you make it not coupled to the code you can easily switch to WCF(if you need it) adding a data contract and an End Point to expose your component as a service(at the end of the day WCF exposes an Interface)
是的,这将是最好的 - 因为这就是 WCF 的用途;由于它是配置驱动的,您将能够使用不同的绑定类型来适应您所在的环境(发送数据)。
假设网络客户端(大部分)都在公共互联网上;使用专用网络将为您提供更多选择。
WCF 可以使用队列作为绑定类型,不确定这是否会给您带来任何优势,因为无论如何您都会将它们放入队列中。使用 http 绑定的同步 WCF 调用将具有良好的性能,因为将其提供给您拥有的 MSMQ 的操作应该非常快。
Yes it would be the best - in that it's what WCF is for; as it's config driven you'll be able to use different binding types to suit the environment you're in (sending the data across).
The assumption is that the web clients are all (mostly) out on the public internet; being on a private network would give you more options.
WCF can use a queue as a binding type, not sure if that gives you any advantage since you're going to put them into a queue anyway. A synchronous WCF call using an http binding will be fine performance wise as the act of giving it to the MSMQ you have should be pretty quick.
看看NServiceBus
Take a look at NServiceBus