无需轮询即可在客户端之间发送消息
我有一个相互连接的 MS SQL 服务器网络,并连接到它们的 (C++/C#) 客户端。我正在设计一种客户端之间的消息传递和服务器-客户端消息传递的方式。 我已经阅读过有关 MS SQL Service Broker 和其他 Broker(例如 Apache Qpid)的内容。 但我仍然不知道这是如何工作的,我会很感激有人可以为我提供更好的资源,或者是否有人已经解决过这样的问题。
我怎样才能使客户端之间无法发送和接收消息?
请确保这不是学校作业或大学课程项目。
我真的很感激任何有用的评论或建议...
+++谢谢+++
I have a network of MS SQL servers connected to each other with (C++/C#)clients connected to them. and I'm about designing a way of messaging between clients and server-client messaging.
I've alread read about MS SQL Service Broker and other Brokers like Apache Qpid.
but still I cant find out how would this work, I would be thankful is someone could provide me with better sources or if someone has already worked with such an issue.
How could I make sending and recieving messages between clients without possible?
and please make sure this is no school homework or university course project.
I would really appreciate any helpful comment or advice...
+++Thanks+++
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
MSDN 有大量有关 SQL Service Broker 的技术信息。这是相当高水平的,但如果你挖掘/阅读足够多,你很快就会成为专业人士。
http://msdn.microsoft.com/en-us /library/ms166043%28SQL.90%29.aspx
互联网上还有大量有用的代码示例,它们应该可以帮助您启动并运行,以便您可以开始试验。
http://blogs.msdn.com/b/sql_service_broker/
http://www.mssqltips.com/tip.asp?tip=1836
祝你好运!
MSDN has quite a bit of technical information regarding SQL Service Broker. It is fairly high-level, but if you dig / read enough you will be a pro in no time.
http://msdn.microsoft.com/en-us/library/ms166043%28SQL.90%29.aspx
There are also a bunch of useful code samples floating around on the internet that should get you up and running so you can start experimenting.
http://blogs.msdn.com/b/sql_service_broker/
http://www.mssqltips.com/tip.asp?tip=1836
Best of Luck!
为什么不民意调查?这很简单,是“可能有效的最愚蠢的事情”。
我建议您考虑轮询,除非您已经确定轮询的问题是什么。
考虑因素:
另外,如果您的应用程序无论如何都有连接心跳,您可以让它报告是否有任何新消息并一石二鸟。
Why not poll? It's easy, the "dumbest thing that could possibly work".
I suggest you consider polling unless you have established what the problem with polling is.
Considerations:
Plus, if your application has a connection heartbeat anyway, you could have it report whether there are any new messages and kill two birds with one stone.
如果您害怕执行“
您总是可以预取”,请设置预取:
然后您可以使用可用的消息功能,但实际上,这听起来像是反向轮询;)
If you are affraid of doing a
You could always prefetch, set the prefetch:
and then you could use the available messages functionality, but in all reality, this sounds like polling, in a backwards way ;)