0

I have an architecture, where there are the following constituents:

  1. External Applicaton (EA) - Third party who makes a request to WCF Service
  2. WCF Service (WS) - All the business logic
  3. Pub-Sub Service (PSS) - Handles publishes and subscriptions
  4. Internal Application (IA) - Subscribes or unsubscribes to Pub-Sub (with CallBacks)

Overview

The external application (EA) references the WCF service (WS) and makes a call to a specific method, to which all Internal Applications (IA) should be notified through the Pub-Sub Service (PSS).

The problem I have is in deciding whether it is feasible or best practice to get one WCF Service (WS) to communicate with another WCF Service (Pub-Sub Service). I've read that this is not a good idea given that requests are processed in a synchronous manner and this could cause inconsistencies in service delivery.

My specific question based on that is - can someone share pro's and con's of allowing two WCF services to talk to one another; or is this a non-issue?

Thanks

4

2 回答 2

1

我同意其他答案,但是由于您的可用资源无法使用面向消息的方法,所以我会这样说。

只要您的 WCF 服务充当客户端(您的“WS”)和服务器(您的“PSS”),它就会共享任何客户端-服务器应用程序的缺陷。但是,这假设了几件事:

a) 您的“WS”对您的“EA”实施单向操作,或“即发即弃”。请参阅此处以获取参考:关于单向调用、回调和事件您需要了解的内容。否则,“EA”将不得不等到您对“PSS”的内部调用完成。

b)您的“WS”通道已配置并且有足够的资源来处理负载,因为单向操作并不是真正异步的;如果通道无法处理负载,则调用将排队并阻塞客户端,直到资源被释放并且可以继续执行。

c) 不需要对保证、交易或有序交付或任何其他类似消息传递的行为进行限制。

但是,之前说过这种场景确实需要基于消息的架构。您有几个故障点,并且对这个依赖链进行故障排除将没有乐趣。

于 2013-07-09T13:48:20.560 回答
1

我完全同意史蒂文的观点。您应该考虑在此处使用消息队列。资源如下:

http://msdn.microsoft.com/en-us/library/ms751499.aspx

http://msdn.microsoft.com/en-us/library/ms731089.aspx

http://www.codeproject.com/Articles/34168/WCF-Queued-Messaging

希望这些就足够了。谢谢。

于 2013-07-09T13:25:43.110 回答