public OrleansTestActorService(StatelessServiceContext context) : base(context) { var esLogsConfig = new FabricConfigProvider<ElasticSearchOutputConfig>("ElasticSearchLogs").Config; var esMetricsConfig = new FabricConfigProvider<ElasticSearchOutputConfig>("ElasticSearchMetrics").Config; var logger = new LoggerConfiguration() .MinimumLevel.Verbose() .Enrich.With(new AzureServiceFabricSerilogEnricher(context)) .Enrich.With<ExceptionEnricher>() .Enrich.With<ActivityIdSerilogEnricher>() .WriteTo.Elasticsearch( new ElasticsearchSinkOptions(new Uri(esLogsConfig.ElasticSearchUri)) { IndexFormat = $"{esLogsConfig.ElasticSearchIndexName}-{{0:yyyy.MM.dd}}" }) .CreateLogger(); Log.Logger = logger; //Metric.Config.WithAllCounters(); _disposable = new TelemetryPipe() .CollectMetricsNet(10, ServiceFabricHelpers.GetEnvironmentProperties(context), true) .SendToElasticSearch(esMetricsConfig) .Start(); TraceLogger.BulkMessageInterval = TimeSpan.FromSeconds(10); Logger.TelemetryConsumers.Add(new SerilogTelemetryConsumer()); Logger.TelemetryConsumers.Add(new MetricNetTelemetryConsumer()); }
public OrleansCommunicationListener( StatelessServiceContext parameters, ClusterConfiguration configuration, IServicePartition servicePartition) { this.parameters = parameters; this.configuration = configuration; this.partition = servicePartition; }
public Recaptcha(StatelessServiceContext serviceContext) { serviceContext.CodePackageActivationContext.ConfigurationPackageModifiedEvent += this.CodePackageActivationContext_ConfigurationPackageModifiedEvent; ConfigurationPackage configPackage = serviceContext.CodePackageActivationContext.GetConfigurationPackageObject("Config"); this.UpdateConfigSettings(configPackage.Settings); }
public static void RegisterComponents(HttpConfiguration config, StatelessServiceContext serviceContext) { UnityContainer container = new UnityContainer(); container.RegisterType<ClusterController>( new TransientLifetimeManager(), new InjectionConstructor( #if LOCAL new FakeCaptcha())); #else new Recaptcha(serviceContext))); #endif config.DependencyResolver = new UnityDependencyResolver(container); }
public Service(StatelessServiceContext serviceContext) : base(serviceContext) { ServiceContext context = serviceContext; ConfigurationPackage config = context.CodePackageActivationContext.GetConfigurationPackageObject("Config"); ConfigurationSection section = config.Settings.Sections["VisualObjectsBoxSettings"]; int numObjects = int.Parse(section.Parameters["ObjectCount"].Value); string serviceName = section.Parameters["ServiceName"].Value; string appName = context.CodePackageActivationContext.ApplicationName; this.ActorServiceUri = new Uri(appName + "/" + serviceName); this.objectBox = new VisualObjectsBox(); this.actorIds = this.CreateVisualObjectActorIds(numObjects); }
/// <summary> /// Initializes a new instance of the type /// </summary> /// <param name="traceId">A unique identifier used to correlate debugging and diagnostics messages</param> /// <param name="componentName">The name of the component to use when writing debugging and diagnostics messages</param> /// <param name="serviceContext">The stateless service context that the context of the service running the listener</param> /// <param name="logger">A service logger used to write debugging and diagnostics messages</param> /// <param name="configurationProvider">The configuration provider for the gateway settings</param> /// <param name="unsupportedConfigurationChangeCallback">A method to call when an unsupported configuration change occurs.</param> public MqttCommunicationListener(Guid traceId, string componentName, StatelessServiceContext serviceContext, IServiceLogger logger, IConfigurationProvider<GatewayConfiguration> configurationProvider, UnsupportedConfigurationChange unsupportedConfigurationChangeCallback) { if (serviceContext == null) throw new ArgumentNullException(nameof(serviceContext)); if (configurationProvider == null) throw new ArgumentNullException(nameof(configurationProvider)); if (logger == null) throw new ArgumentNullException(nameof(logger)); this.logger = logger; this.componentName = componentName; this.serviceContext = serviceContext; this.configurationProvider = configurationProvider; this.unsupportedConfigurationChangeCallback = unsupportedConfigurationChangeCallback; // optimizing IOCP performance int minWorkerThreads; int minCompletionPortThreads; ThreadPool.GetMinThreads(out minWorkerThreads, out minCompletionPortThreads); ThreadPool.SetMinThreads(minWorkerThreads, Math.Max(16, minCompletionPortThreads)); this.logger.CreateCommunicationListener(traceId, this.componentName, this.GetType().FullName, this.BuildListeningAddress(this.configurationProvider.Config)); }
public Startup(StatelessServiceContext serviceContext) { this.serviceContext = serviceContext; }
public ActorCallerService(StatelessServiceContext serviceContext, IActorProxyFactory proxyFactory = null) : base(serviceContext) { ProxyFactory = proxyFactory ?? new ActorProxyFactory(); }
public EventProcessorHostListener(StatelessServiceContext context) { this.context = context; }
public ABP_CORE_SPA(StatelessServiceContext context) : base(context) { }
public CarScanProcessor(StatelessServiceContext context) : base(context) { }
public DeviceManagementWebService(StatelessServiceContext context) : base(context) { }
public OwinCommunicationListener(string appRoot, IOwinAppBuilder startup, StatelessServiceContext context) { this.startup = startup; this.appRoot = appRoot; this.context = context; }
public ConfigSettings(StatelessServiceContext context) { context.CodePackageActivationContext.ConfigurationPackageModifiedEvent += CodePackageActivationContext_ConfigurationPackageModifiedEvent; UpdateConfigSettings(context.CodePackageActivationContext.GetConfigurationPackageObject("Config").Settings); }
public LineManagerLeaveApprovalService(StatelessServiceContext context) : base(context) { }
public ResourceProviderService(StatelessServiceContext serviceContext, IConfigurationRoot configuration) : base(serviceContext) { this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); }
public BootcampService(StatelessServiceContext context) : base(context) { }
public FabicHostedService(StatelessServiceContext serviceContext, T hostedService) : base(serviceContext) { this.hostedService = hostedService; }
public OwinCommunicationListener(string appRoot, IOwinAppBuilder startup, StatelessServiceContext statelessServiceContext) { this.startup = startup; this.appRoot = appRoot; this.statelessServiceContext = statelessServiceContext; }
public SubscribingStatelessService(StatelessServiceContext serviceContext) : base(serviceContext) { _subscriberServiceHelper = new SubscriberServiceHelper(new BrokerServiceLocator()); }
public GatewayService(StatelessServiceContext serviceContext, AspNetCoreCommunicationContext communicationContext) : base(serviceContext) { _communicationContext = communicationContext; }
public aadb2cmicroservice(StatelessServiceContext context) : base(context) { }
public EventProcessorHostService(StatelessServiceContext context) : base(context) { }
public Service(StatelessServiceContext context) : base(context) { }
public retriever(StatelessServiceContext context) : base(context) { }
public WebHostingService(StatelessServiceContext serviceContext, string endpointName) : base(serviceContext) { _endpointName = endpointName; }
public WebHostingService(StatelessServiceContext serviceContext, string endpointName) : base(serviceContext) { _endpointName = endpointName; }
//static CalculatorService() //{ // Trace.TraceInformation($"Ensuring Actor assembly '{typeof(CalculatorActor).Assembly}' is loaded."); //} public CalculatorService(StatelessServiceContext serviceContext) : base(serviceContext) { }
public StatelessWrapper(StatelessServiceContext context) : base(context) { }
public EventHubRoomActorService(StatelessServiceContext context) : base(context) { }
public CalculatorService(StatelessServiceContext context) : base(context) { }
public TrackingStoreService(StatelessServiceContext context, ITrackerStoreRepository trackerStoreRepository) : base(context) { _trackerStoreRepository = trackerStoreRepository; }
public ReactWeb(StatelessServiceContext context) : base(context) { }
public Alams(StatelessServiceContext context) : base(context) { }
public TcpServer(StatelessServiceContext context) : base(context) { }
public SampleService(StatelessServiceContext context) : base(context) { _settings = new ConfigSettings(context); Log.Logger = new ConfigLogging().CreateLogger(_settings.Environment, _settings.ApplicationName, _settings.LogglyToken); }
public GatewayService(StatelessServiceContext context) : base(context) { WinApi.TimeBeginPeriod(1); //improve sleep precision for polling type transports float timeoutDebugMultiplier = 1; var builder = new ContainerBuilder(); var esLogsConfig = new FabricConfigProvider<ElasticSearchOutputConfig>("ElasticSearchLogs").Config; var esMetricsConfig = new FabricConfigProvider<ElasticSearchOutputConfig>("ElasticSearchMetrics").Config; var logger = new LoggerConfiguration() .ConfigureMOUSETypesDestructure() .MinimumLevel.Error() .Enrich.With(new AzureServiceFabricSerilogEnricher(context)) .Enrich.With<ExceptionEnricher>() .Enrich.With<ActivityIdSerilogEnricher>() .WriteTo.Elasticsearch( new ElasticsearchSinkOptions(new Uri(esLogsConfig.ElasticSearchUri)) { IndexFormat = $"{esLogsConfig.ElasticSearchIndexName}-{{0:yyyy.MM.dd}}" }) .CreateLogger(); Log.Logger = logger; builder.RegisterInstance(logger).As<ILogger>(); builder.RegisterType<SerilogCoreEvents>().As<ICoreEvents>(); builder.RegisterType<SerilogActorCoreEvents>().As<IActorCoreEvents>(); builder.RegisterType<SerilogLidgrenEvents>().As<ILidgrenEvents>(); Metric.Config.WithAllCounters(); _metricsSubscription = new TelemetryPipe() .CollectMetricsNet(5, ServiceFabricHelpers.GetEnvironmentProperties(context), true) .SendToElasticSearch(esMetricsConfig) .Start(); builder.Register( c => new ProtobufMessageSerializer(typeof(Message).Assembly, typeof(TestStateless).Assembly)) .As<IMessageSerializer>(); var publicEndpoint = FabricRuntime.GetActivationContext().GetEndpoint("Public"); var public2Endpoint = FabricRuntime.GetActivationContext().GetEndpoint("Public2"); var public3Endpoint = FabricRuntime.GetActivationContext().GetEndpoint("Public3"); var nodeIP = Dns.GetHostAddresses(FabricRuntime.GetNodeContext().IPAddressOrFQDN).First(x => x.AddressFamily == AddressFamily.InterNetwork); var publicNetConfig = new NetPeerConfiguration("PublicNet") { LocalAddress = nodeIP, MaximumConnections = 10000, AcceptIncomingConnections = true, Port = publicEndpoint.Port, ConnectionTimeout = 10*timeoutDebugMultiplier }; var public2NetConfig = new NetPeerConfiguration("PublicNet") { LocalAddress = nodeIP, MaximumConnections = 10000, AcceptIncomingConnections = true, Port = public2Endpoint.Port, ConnectionTimeout = 10 * timeoutDebugMultiplier }; var public3NetConfig = new NetPeerConfiguration("PublicNet") { LocalAddress = nodeIP, MaximumConnections = 10000, AcceptIncomingConnections = true, Port = public3Endpoint.Port, ConnectionTimeout = 10 * timeoutDebugMultiplier }; var testActorsNetConfig = new NetPeerConfiguration("TestActors") { LocalAddress = nodeIP, AcceptIncomingConnections = false, Port = 0, ConnectionTimeout = 10 * timeoutDebugMultiplier }; builder.RegisterType<WcfBufferPool>().As<IBufferPool>(); builder.Register(c => { var messageSerialer = c.Resolve<IMessageSerializer>(); var coreLogger = c.Resolve<ICoreEvents>(); var nedNodeConfig = c.Resolve<INetNodeConfig>(); var bufferPool = c.Resolve<IBufferPool>(); return new NetNode<SFActorsBackendClientNetChannel>("PublicNet", new LidgrenNetProvider(publicNetConfig, c.Resolve<ILidgrenEvents>()), coreLogger, messageSerialer, (node, transport) => new SFActorsBackendClientNetChannel(node, transport, messageSerialer, coreLogger, nedNodeConfig, bufferPool), nedNodeConfig); }) .As<INetNode>() .SingleInstance(); builder.Register(c => { var actorSystem = c.Resolve<IActorSystem<ITestActor>>(); var messageSerialer = c.Resolve<IMessageSerializer>(); var coreLogger = c.Resolve<ICoreEvents>(); var netNodeConfig = c.Resolve<INetNodeConfig>(); var bufferPool = c.Resolve<IBufferPool>(); return new NetNode<MouseActorsBackendClientNetChannel>("PublicNet2", new LidgrenNetProvider(public2NetConfig, c.Resolve<ILidgrenEvents>()), coreLogger, messageSerialer, (node, transport) => new MouseActorsBackendClientNetChannel(actorSystem, node, transport, messageSerialer, coreLogger, netNodeConfig, bufferPool), netNodeConfig); }) .As<INetNode>() .SingleInstance(); builder.Register(c => { var messageSerialer = c.Resolve<IMessageSerializer>(); var coreLogger = c.Resolve<ICoreEvents>(); var netNodeConfig = c.Resolve<INetNodeConfig>(); var bufferPool = c.Resolve<IBufferPool>(); return new NetNode<OrleansBackendClientNetChannel>("PublicNet3", new LidgrenNetProvider(public3NetConfig, c.Resolve<ILidgrenEvents>()), coreLogger, messageSerialer, (node, transport) => new OrleansBackendClientNetChannel(node, transport, messageSerialer, coreLogger, netNodeConfig, bufferPool), netNodeConfig); }) .As<INetNode>() .SingleInstance(); builder.Register(c => new ServiceFabricActorSystemNetNode<ITestActor>("TestActors", new Uri("fabric:/MouseTestActor.Deploy/MouseTestActor"), new LidgrenNetProvider(testActorsNetConfig, c.Resolve<ILidgrenEvents>()), c.Resolve<IActorCoreEvents>(), c.Resolve<ICoreEvents>(), c.Resolve<IMessageSerializer>(), c.Resolve<INetNodeConfig>(), c.Resolve<IBufferPool>())) .As<INetNode>() .As<IActorSystem<ITestActor>>() .SingleInstance(); builder.Register(c => new NetNodeConfig() { SendTimeoutSec = (int) (10.0*timeoutDebugMultiplier), ConnectTimeoutSec = (int) (10*timeoutDebugMultiplier) }).As<INetNodeConfig>(); var container = builder.Build(); _netNodes = container.Resolve<IEnumerable<INetNode>>(); var config = new ClientConfiguration { //DataConnectionString = "DefaultEndpointsProtocol=https;AccountName=actorchatstorage;AccountKey=1hCY/Ak2TFrqE61cMhbPU5rkv9PuDfX7QQFU4tXCSc2AO78hLdm6u3PrGrZbUzOj7OkIZ93YKbU81VSVnBMbPg==", DataConnectionString = "UseDevelopmentStorage=true", PropagateActivityId = true, DefaultTraceLevel = Severity.Info, GatewayProvider = ClientConfiguration.GatewayProviderType.AzureTable, TraceToConsole = true, StatisticsCollectionLevel = StatisticsLevel.Critical, StatisticsLogWriteInterval = TimeSpan.FromDays(6), TraceFileName = null, TraceFilePattern = null, ResponseTimeout = TimeSpan.FromSeconds(90), StatisticsMetricsTableWriteInterval = TimeSpan.FromDays(6), StatisticsPerfCountersWriteInterval = TimeSpan.FromDays(6), }; OrleansFabricClient.Initialize(new Uri("fabric:/OrleansTest/OrleansTestActor"), config); }
public CounterActorWebService(StatelessServiceContext context) : base(context) { }
public WebHostingService(StatelessServiceContext serviceContext) : base(serviceContext) { this.httpClient = new Lazy<HttpClient>(this.CreateHttpClient); this.serviceMonitor = new Lazy<ServiceMonitor>(() => new ServiceMonitor(this.Context, this.Partition)); }
public InitializationService(StatelessServiceContext context) : base(context) { }
public HelloWorldService(StatelessServiceContext context) : base(context) { }
public WebHostingService(StatelessServiceContext serviceContext, IServiceProvider services) : base(serviceContext) { this._services = services; }
public WebApp2(StatelessServiceContext context) : base(context) { }
public RemindersController(StatelessServiceContext context) { this.context = context; }
public MyStateless(StatelessServiceContext context) : base(context) { }
public MeetupStatelessService( StatelessServiceContext context ) : base( context ) { }
public MessagesSender(StatelessServiceContext context) : base(context) { }
public WebService(StatelessServiceContext context) : base(context) { }
public Api(StatelessServiceContext context) : base(context) { }
public TcpCommunicationListener(StatelessServiceContext context) { _context = context; }
public Products(StatelessServiceContext context) : base(context) { }
public StatelessBankingApi(StatelessServiceContext context) : base(context) { }
public slacker(StatelessServiceContext context) : base(context) { }
public PublisherService(StatelessServiceContext context) : base(context) { }
public SampleQueueListeningStatelessService(StatelessServiceContext serviceContext) : base(serviceContext) { }
public GroupsService(StatelessServiceContext context, IGroupsManager groupsManager) : base(context) { this.groupsManager = groupsManager; }
public HomeController(StatelessServiceContext context) { this.context = context; }
public ApiGateway(StatelessServiceContext context) : base(context) { }
public WebService(StatelessServiceContext context) : base(context) { this.fabricClient = new FabricClient(); }
public Listener(StatelessServiceContext context) : base(context) { }