Exemple #1
0
        /// <summary>
        /// FabricTransportRemotingListenerSettings returns the default Settings .Loads the configuration file from default Config Package"Config" .
        ///</summary>
        /// <param name="sectionName">Name of the section within the configuration file. If not found section in configuration file, it will return the default Settings</param>
        /// <returns></returns>
        internal static FabricTransportRemotingListenerSettings GetDefault(
            string sectionName = FabricTransportSettings.DefaultSectionName)
        {
            var listenerinternalSettings = FabricTransportListenerSettings.GetDefault(sectionName);

            return(new FabricTransportRemotingListenerSettings(listenerinternalSettings));
        }
Exemple #2
0
        /// <summary>
        /// Loads the FabricTransport settings from a section specified in the service settings configuration file - settings.xml
        /// </summary>
        /// <param name="sectionName">Name of the section within the configuration file. if not found , it throws ArgumentException.</param>
        /// <param name="configPackageName"> Name of the configuration package. if not found Settings.xml in the configuration package path, it throws ArgumentException.
        /// If not specified, default name is "Config"</param>
        /// <returns>FabricTransportRemotingListenerSettings</returns>
        /// <remarks>
        /// The following are the parameter names that should be provided in the configuration file,to be recognizable by service fabric to load the transport settings.
        ///
        ///     1. MaxQueueSize - <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings.MaxQueueSize"/>value in long.
        ///     2. MaxMessageSize - <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings.MaxMessageSize"/>value in bytes.
        ///     3. MaxConcurrentCalls - <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings.MaxConcurrentCalls"/>value in long.
        ///     4. SecurityCredentials - <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings.SecurityCredentials"/> value.
        ///     5. OperationTimeoutInSeconds - <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings.OperationTimeout"/> value in seconds.
        ///     6. KeepAliveTimeoutInSeconds - <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings.KeepAliveTimeout"/> value in seconds.
        /// </remarks>
        public static FabricTransportRemotingListenerSettings LoadFrom(string sectionName,
                                                                       string configPackageName = null)
        {
            var listenerSettings = FabricTransportListenerSettings.LoadFrom(sectionName, configPackageName);

            return(new FabricTransportRemotingListenerSettings(listenerSettings));
        }
        private static FabricTransportListenerSettings GetDefaultFabricTransportListenerSettings(string sectionName = "TransportSettings")
        {
            var listenerSettings = (FabricTransportListenerSettings)null;

            if (!FabricTransportListenerSettings.TryLoadFrom(sectionName, out listenerSettings, (string)null))
            {
                listenerSettings = new FabricTransportListenerSettings();
            }
            return(listenerSettings);
        }
Exemple #4
0
        /// <summary>
        /// Optional override to create listeners (e.g., HTTP, Service Remoting, WCF, etc.) for this service replica to handle client or user requests.
        /// </summary>
        /// <remarks>
        /// For more information on service communication, see http://aka.ms/servicefabricservicecommunication
        /// </remarks>
        /// <returns>A collection of listeners.</returns>
        protected override IEnumerable <ServiceReplicaListener> CreateServiceReplicaListeners()
        {
            FabricTransportListenerSettings listenerSettings = new FabricTransportListenerSettings();

            listenerSettings.MaxMessageSize = (1024 * 1024 * 1024);

            return(new[]
            {
                new ServiceReplicaListener(context => new FabricTransportServiceRemotingListener(context, this, listenerSettings)),
            });
        }
Exemple #5
0
        /// <summary>
        /// Try to load the FabricTransport settings from a section specified in the service settings configuration file - settings.xml
        /// </summary>
        /// <param name="sectionName">Name of the section within the configuration file. if not found , it return false</param>
        /// <param name="configPackageName"> Name of the configuration package. if not found Settings.xml in the configuration package path, it return false.
        /// If not specified, default name is "Config"</param>
        /// <param name="remotingListenerSettings">When this method returns it sets the <see cref="FabricTransportRemotingListenerSettings"/> listenersettings if load from Config succeeded. If fails ,its sets listenerSettings to null/> </param>
        /// <returns> <see cref="bool"/> specifies whether the settings get loaded successfully from Config.
        /// It returns true when load from Config succeeded, else return false.</returns>
        /// <remarks>
        /// The following are the parameter names that should be provided in the configuration file,to be recognizable by service fabric to load the transport settings.
        ///
        ///     1. MaxQueueSize - <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings.MaxQueueSize"/>value in long.
        ///     2. MaxMessageSize - <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings.MaxMessageSize"/>value in bytes.
        ///     3. MaxConcurrentCalls - <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings.MaxConcurrentCalls"/>value in long.
        ///     4. SecurityCredentials - <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings.SecurityCredentials"/> value.
        ///     5. OperationTimeoutInSeconds - <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings.OperationTimeout"/> value in seconds.
        ///     6. KeepAliveTimeoutInSeconds - <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings.KeepAliveTimeout"/> value in seconds.
        /// </remarks>
        public static bool TryLoadFrom(string sectionName,
                                       out FabricTransportRemotingListenerSettings remotingListenerSettings,
                                       string configPackageName = null)
        {
            FabricTransportListenerSettings listenerSettings;
            var isSucceded = FabricTransportListenerSettings.TryLoadFrom(sectionName, out listenerSettings,
                                                                         configPackageName);

            if (isSucceded)
            {
                remotingListenerSettings = new FabricTransportRemotingListenerSettings(listenerSettings);
                return(true);
            }
            remotingListenerSettings = null;
            return(false);
        }
        /// <summary>
        /// FabricTransportRemotingListenerSettings returns the default Settings .Loads the configuration file from default Config Package"Config" .
        ///</summary>
        /// <param name="sectionName">Name of the section within the configuration file. If not found section in configuration file, it will return the default Settings</param>
        /// <returns></returns>
        internal static FabricTransportRemotingListenerSettings GetDefault(
            string sectionName = FabricTransportSettings.DefaultSectionName)
        {
            var listenerinternalSettings = FabricTransportListenerSettings.GetDefault(sectionName);

            var settings = new FabricTransportRemotingListenerSettings(listenerinternalSettings);

            AppTrace.TraceSource.WriteInfo(
                Tracetype,
                "MaxMessageSize: {0} , MaxConcurrentCalls: {1} , MaxQueueSize: {2} , OperationTimeoutInSeconds: {3} KeepAliveTimeoutInSeconds : {4} , SecurityCredentials {5} , HeaderBufferSize {6}," +
                "HeaderBufferCount {7} ",
                settings.MaxMessageSize,
                settings.MaxConcurrentCalls,
                settings.MaxQueueSize,
                settings.OperationTimeout.TotalSeconds,
                settings.KeepAliveTimeout.TotalSeconds,
                settings.SecurityCredentials.CredentialType,
                settings.HeaderBufferSize,
                settings.HeaderMaxBufferCount);


            return(settings);
        }
 public FabricTransportServiceRemotingListener(ServiceContext serviceContext, IService serviceImplementation, FabricTransportListenerSettings listenerSettings)
 {
 }
Exemple #8
0
 private FabricTransportRemotingListenerSettings(FabricTransportListenerSettings listenerSettings)
 {
     this.listenerSettings = listenerSettings;
 }
Exemple #9
0
 /// <summary>
 /// Creates a new instance of FabricTransportRemotingListenerSettings and initializes properties with default Values.
 /// </summary>
 public FabricTransportRemotingListenerSettings()
 {
     this.listenerSettings = new FabricTransportListenerSettings();
 }
 /// <summary>
 /// Creates a new instance of FabricTransportRemotingListenerSettings and initializes properties with default Values.
 /// </summary>
 public FabricTransportRemotingListenerSettings()
 {
     this.listenerSettings     = new FabricTransportListenerSettings();
     this.headerBufferSize     = Constants.DefaultHeaderBufferSize;
     this.headerMaxBufferCount = Constants.DefaultHeaderMaxBufferCount;
 }