0

ServiceModel.Routing 上的默认服务行为是什么?

我不是在谈论 Azure 的东西,我的意思是这些接口来自

System.ServiceModel.Routing

  • IDuplexSessionRouter
  • IRequestReplyRouter
  • ISimplexDatagramRouter
  • ISimplexSessionRouter

我了解在工作的实际服务端点为所需上下文选择正确的“绑定”,....

(即这个路由器(hand-rolled-service_bus)实际上将(通过 EndPointName)消息路由到的服务)

(当然,将来会有几个服务根据调用者提供的 ---EndPointName--- 路由到各种服务)

...但是这些路由“合同”在这个中间层如何处理并发和实例模式实现这些 System.ServiceModel.Routing 命名空间接口中的一个或多个的 路由服务?!

我是否过度思考这些路由合同(接口)只是传递消息?当我输入这个时,我想知道我是否应该真正创建一个继承所需路由接口/合同的类,并尝试手动应用我所需的服务行为,就像普通的WCF 接口一样......

所有示例都只是“使用”这些路由接口,而不是创建实现其中一个的类并在其后附加服务行为。

4

1 回答 1

0

“路由服务”只是根据路由表将消息传递给目标服务。

根据System.ServiceModel.Routing.dll, v4.0.0.0程序集,接口 InstanceContextMode = InstanceContextMode.PerSession定义如下:

namespace System.ServiceModel.Routing
{
    // Summary:
    //     Defines the routing service, which is responsible for routing messages between
    //     endpoints based on filter criteria.
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    [ServiceBehavior(AddressFilterMode = AddressFilterMode.Any, InstanceContextMode = InstanceContextMode.PerSession, UseSynchronizationContext = false, ValidateMustUnderstand = false)]
    public sealed class RoutingService : ISimplexDatagramRouter, ISimplexSessionRouter, IRequestReplyRouter, IDuplexSessionRouter, IDisposable
    {
    }
}
于 2015-01-05T21:10:44.383 回答