Пример #1
0
        private string GetActorMethodName(ActorMessageHeaders actorMessageHeaders)
        {
            if (actorMessageHeaders == null)
            {
                return(null);
            }
            try
            {
                var methodName = "-";
                var lookup     = HashUtil.Combine(actorMessageHeaders.InterfaceId, actorMessageHeaders.MethodId);
                if (MethodMap.ContainsKey(lookup))
                {
                    methodName = MethodMap[lookup];
                    return(methodName);
                }

                methodName = ((Microsoft.ServiceFabric.Actors.Remoting.Runtime.ActorServiceRemotingDispatcher) this).GetMethodDispatcherMapName(
                    actorMessageHeaders.InterfaceId, actorMessageHeaders.MethodId);
                MethodMap[lookup] = methodName;
                return(methodName);
            }
            catch (Exception ex)
            {
                // ignored
                CommunicationLogger?.FailedToGetActorMethodName(actorMessageHeaders, ex);
            }
            return(null);
        }
Пример #2
0
        private string GetServiceMethodName(ServiceRemotingMessageHeaders messageHeaders)
        {
            if (messageHeaders == null)
            {
                return(null);
            }

            try
            {
                var methodName = "-";
                var lookup     = HashUtil.Combine(messageHeaders.InterfaceId, messageHeaders.MethodId);
                if (ServiceMethodMap.ContainsKey(lookup))
                {
                    methodName = ServiceMethodMap[lookup];
                    return(methodName);
                }

                methodName = _serviceMethodDispatcher.GetMethodDispatcherMapName(
                    messageHeaders.InterfaceId, messageHeaders.MethodId);
                ServiceMethodMap[lookup] = methodName;
                return(methodName);
            }
            catch (Exception ex)
            {
                // ignored
                //_logger?.FailedToGetActorMethodName(actorMessageHeaders, ex);
            }
            return(null);
        }
 private string GetServiceMethodName(int interfaceId, int methodId)
 {
     try
     {
         var lookup = HashUtil.Combine(interfaceId, methodId);
         if (ServiceMethodMap.ContainsKey(lookup))
         {
             return(ServiceMethodMap[lookup]);
         }
         var methodName = ((Microsoft.ServiceFabric.Services.Remoting.Runtime.ServiceRemotingDispatcher)_innerMessageHandler).GetMethodDispatcherMapName(interfaceId, methodId);
         ServiceMethodMap[lookup] = methodName;
         return(methodName);
     }
     catch (Exception ex)
     {
         // Ignored
         _logger?.FailedToGetServiceMethodName(_service.GetServiceContext().ServiceName, interfaceId, methodId, ex);
     }
     return(null);
 }
 private string GetMethodName(int interfaceId, int methodId)
 {
     try
     {
         var lookup = HashUtil.Combine(interfaceId, methodId);
         if (MethodMap.ContainsKey(lookup))
         {
             return(MethodMap[lookup]);
         }
         var methodName = this.GetMethodDispatcherMapName(interfaceId, methodId);
         MethodMap[lookup] = methodName;
         return(methodName);
     }
     catch (Exception ex)
     {
         // Ignored
         CommunicationLogger?.FailedToGetServiceMethodName(interfaceId, methodId, ex);
     }
     return("-");
 }