本文介绍了WCF到WCF通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个结构,其中有下列成分:

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


  1. 外部应用(EA) - 第三方谁对WCF服务
  2. 的请求
  3. WCF服务(WS) - 所有的业务逻辑

  4. 发布 - 订阅服务(PSS) - 处理发布和订阅

  5. 内部应用程序(IA) - 签订或取消订阅发布 - 订阅(有回调)

外部应用程序(EA)引用WCF服务(WS),使一个特定方法的调用,这是所有内部应用(IA)应通过发布 - 订阅服务(PSS)。通知

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).

我的问题是,在决定是否可行,或者得到一个WCF服务(WS)与另一个WCF服务(发布 - 订阅服务)进行通信的最佳实践。我读过,这是不是因为请求以同步的方式处理,这可能会导致服务交付不一致是一个好主意。

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.

我的基于特定的问题是 - 可以有人分享亲的和允许两个WCF服务,彼此交谈的反对的;或者这是一个非问题?

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?

感谢

推荐答案

我同意其他的答案,但是,由于面向消息的做法是不符合您的可用资源是可行的,我会这样说。

I agree with the other answers, however since a message oriented approach is not feasible with your available resources, I'll put it this way.

只要你的WCF服务作为客户端(你的WS)和服务器(你的'PSS'),这将分享任何客户端 - 服务器应用程序的缺陷。
然而,这种假设一两件事情:

As long as your WCF services are acting as a client (your 'WS') and a server (your 'PSS'), it will share the pitfalls of any client-server application.However, this assumes a couple of things:

a)您的WS实现单向操作,即射后不理,对你的EA。看到这里,以供参考:的。否则,智能交易将不得不等待,直到你的内部呼叫PSS结束。

a) Your 'WS' implements One-Way operations, or "fire and forget", towards your 'EA'. See here for reference: What You Need To Know About One-Way Calls, Callbacks, And Events. Otherwise, the 'EAs' will have to wait until your internal call to 'PSS' completes.

B)您的WS通道配置,并具有良好的和足够的资源来处理负载,因为单向操作是不是真的异步的;如果信道不能处理来电的负荷将排队,并阻止客户端的,直到资源被释放,可以继续执行。

b) Your 'WS' channel is configured and has well and enough resources to handle the load, because One-Way operations aren't really asynchronous; if the channel can't handle the load the calls will queue up and block the client until resources are freed and execution can continue.

c)不限制为保障,事务管理和有序传递,或任何其他消息类似的行为是必要的。

c) No constraints as to guaranteed, transactional or ordered delivery or any other messaging-like behavior is required.

但是,一个之前说这种情况确实要求基于消息的架构。你有失败的几个点,解决此链的依赖将是没有乐趣。

But, a said before this sort of scenario really calls for a message based architecture. You have several points of failure and troubleshooting this chain of dependencies will be no fun.

这篇关于WCF到WCF通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 20:36