请求超时问题
我有带有 WCF 服务的 Web 应用程序。该服务包含实现消息通知的方法。问题是,对于大量用户,需要花费太多时间并引发请求超时异常。解决这个问题的最好方法是什么。无法增加请求时间,用户不会等待超过一分钟。也许多线程或异步调用通知方法会有帮助?或者有更好的解决方案吗?
I have web application with WCF service. That service contains method that implements message notification. The problem is that with big number of users it takes too much time and throws request timeout exception. What is the best way to solve this problem. Increasing time for request is not available, user won't wait more than minute. Maybe multi-threading or async invocation of notification method will help? Or is there better solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的通知方法对于有效服务请求不是必需的,则将其移至另一个线程。
作为架构点,您可以考虑将所有通知移至其自己的服务,然后可以异步使用该服务的 API。
请参阅此处了解操作方法。
If your notification method is not essential for the request to be serviced effectively, then move it to another thread.
As an architectural point you may consider moving all notifications to their own service, the API of which can then be consumed asynchronously.
See here for how.