internal CorrelatingFabricTransportServiceRemotingClientFactory(
            FabricTransportRemotingSettings remotingSettings = null,
            IServiceRemotingCallbackMessageHandler remotingCallbackMessageHandler = null,
            IServicePartitionResolver servicePartitionResolver = null,
            IEnumerable <IExceptionHandler> exceptionHandlers  = null,
            string traceId = null,
            IServiceRemotingMessageSerializationProvider serializationProvider = null,
            IServiceRemotingClientFactory inner = null,
            Action <CallSummary> raiseSummary   = null,
            string remoteServiceName            = null)
        {
            if (inner == null)
            {
                inner = new FabricTransportServiceRemotingClientFactory(
                    remotingSettings,
                    remotingCallbackMessageHandler,
                    servicePartitionResolver,
                    exceptionHandlers,
                    traceId,
                    serializationProvider);
            }

            _inner             = inner;
            _raiseSummary      = raiseSummary;
            _remoteServiceName = remoteServiceName ?? "unknown";
        }
        public static ServiceProxyFactory GetServiceProxyFactory()
        {
            FabricTransportRemotingSettings transportSettings = new FabricTransportRemotingSettings
            {
                OperationTimeout   = TimeSpan.FromSeconds(600),
                MaxMessageSize     = 1000000,
                MaxConcurrentCalls = 100
            };
            var retrySettings = new OperationRetrySettings(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(3), 5);
            var clientFactory = new FabricTransportServiceRemotingClientFactory(transportSettings);

            return(new ServiceProxyFactory((c) => clientFactory, retrySettings));
        }
Пример #3
0
        internal CorrelatingFabricTransportServiceRemotingClientFactory(
            FabricTransportRemotingSettings remotingSettings = null,
            IServiceRemotingCallbackMessageHandler remotingCallbackMessageHandler = null,
            IServicePartitionResolver servicePartitionResolver = null,
            IEnumerable <IExceptionHandler> exceptionHandlers  = null,
            string traceId = null,
            IServiceRemotingMessageSerializationProvider serializationProvider = null,
            IServiceRemotingClientFactory inner = null)
        {
            if (inner == null)
            {
                inner = new FabricTransportServiceRemotingClientFactory(
                    remotingSettings,
                    remotingCallbackMessageHandler,
                    servicePartitionResolver,
                    exceptionHandlers,
                    traceId,
                    serializationProvider);
            }

            _inner = inner;
        }
Пример #4
0
        /// <summary>
        /// This is the entry point of the service host process.
        /// </summary>
        private static async Task Main()
        {
            try
            {
                // This line registers an Actor Service to host your actor class with the Service Fabric runtime.
                // The contents of your ServiceManifest.xml and ApplicationManifest.xml files
                // are automatically populated when you build this project.
                // For more information, see https://aka.ms/servicefabricactorsplatform

                var proxyFactory = new FabricTransportServiceRemotingClientFactory();

                await ActorRuntime.RegisterActorAsync <SactorService>(
                    (context, actorType) => new ActorService(context, actorType));

                Thread.Sleep(Timeout.Infinite);
            }
            catch (Exception e)
            {
                ActorEventSource.Current.ActorHostInitializationFailed(e.ToString());
                throw;
            }
        }
        public override IServiceRemotingClientFactory CreateServiceRemotingClientFactory(IServiceRemotingCallbackClient callbackClient)
        {
            FabricTransportServiceRemotingClientFactory factory = new FabricTransportServiceRemotingClientFactory(callbackClient: callbackClient);

            return(new CustomFabricTransportServiceRemotingClientFactory(factory));
        }
Пример #6
0
 /// <summary>
 ///     Initializes a new instance of SactorService
 /// </summary>
 /// <param name="actorService">The Microsoft.ServiceFabric.Actors.Runtime.ActorService that will host this actor instance.</param>
 /// <param name="actorId">The Microsoft.ServiceFabric.Actors.ActorId for this actor instance.</param>
 public SactorService(ActorService actorService, ActorId actorId, FabricTransportServiceRemotingClientFactory clientFactory)
     : base(actorService, actorId)
 {
     _clientFactory = clientFactory;
 }