protected AbstractMsmqListener( IQueueStrategy queueStrategy, Uri endpoint, int threadCount, IMessageSerializer messageSerializer, IEndpointRouter endpointRouter, TransactionalOptions transactional, IMessageBuilder<Message> messageBuilder) { this.queueStrategy = queueStrategy; this.messageSerializer = messageSerializer; this.endpointRouter = endpointRouter; this.endpoint = endpoint; this.threadCount = threadCount; threads = new Thread[threadCount]; switch (transactional) { case TransactionalOptions.Transactional: this.transactional = true; break; case TransactionalOptions.NonTransactional: this.transactional = false; break; case TransactionalOptions.FigureItOut: this.transactional = null; break; default: throw new ArgumentOutOfRangeException("transactional"); } this.messageBuilder = messageBuilder; this.messageBuilder.Initialize(Endpoint); }
public DistributedHashTable( string database, Uri url, IEndpointRouter endpointRouter, IServiceBus bus, Node metadata) { Url = url; this.endpointRouter = endpointRouter; this.bus = bus; Metadata = metadata; if (Metadata != null) // sole node in the network, probably { Metadata.ExecuteSync(uri => { ServiceUtil.Execute<IDistributedHashTableMetaDataProvider>(uri, srv => { failOver = srv.GetNodeByUri(url); }); }); } try { hashTable = new PersistentHashTable(database); hashTable.Initialize(); } catch (Exception) { hashTable.Dispose(); throw; } }
/// <summary> /// Invokes the middleware. /// </summary> /// <param name="context">The context.</param> /// <param name="router">The router.</param> /// <param name="session">The user session.</param> /// <param name="events">The event service.</param> /// <param name="issuerNameService">The issuer name service</param> /// <param name="backChannelLogoutService"></param> /// <returns></returns> public async Task Invoke( HttpContext context, IEndpointRouter router, IUserSession session, IEventService events, IIssuerNameService issuerNameService, IBackChannelLogoutService backChannelLogoutService) { // this will check the authentication session and from it emit the check session // cookie needed from JS-based signout clients. await session.EnsureSessionIdCookieAsync(); context.Response.OnStarting(async() => { if (context.GetSignOutCalled()) { _logger.LogDebug("SignOutCalled set; processing post-signout session cleanup."); // this clears our session id cookie so JS clients can detect the user has signed out await session.RemoveSessionIdCookieAsync(); // back channel logout var logoutContext = await session.GetLogoutNotificationContext(); if (logoutContext != null) { await backChannelLogoutService.SendLogoutNotificationsAsync(logoutContext); } } }); try { var endpoint = router.Find(context); if (endpoint != null) { LicenseValidator.ValidateIssuer(await issuerNameService.GetCurrentAsync()); _logger.LogInformation("Invoking IdentityServer endpoint: {endpointType} for {url}", endpoint.GetType().FullName, context.Request.Path.ToString()); var result = await endpoint.ProcessAsync(context); if (result != null) { _logger.LogTrace("Invoking result: {type}", result.GetType().FullName); await result.ExecuteAsync(context); } return; } } catch (Exception ex) { await events.RaiseAsync(new UnhandledExceptionEvent(ex)); _logger.LogCritical(ex, "Unhandled exception: {exception}", ex.Message); throw; } await _next(context); }
public async Task Invoke(HttpContext context, IEndpointRouter router /*, IUserSession session, IEventService events*/) { try { IEndpointHandler endpoint = router.Find(context); if (endpoint != null) { _logger.LogInformation("Invoking IdentityServer endpoint: {endpointType} for {url}", endpoint.GetType().FullName, context.Request.Path.ToString()); IEndpointResult result = await endpoint.ProcessAsync(context); if (result != null) { _logger.LogTrace("Invoking result: {type}", result.GetType().FullName); await result.ExecuteAsync(context); } return; } } catch (Exception ex) { //await events.RaiseAsync(new UnhandledExceptionEvent(ex)); _logger.LogCritical(ex, "Unhandled exception: {exception}", ex.Message); throw; } await _next(context); }
/// <summary> /// Invokes the middleware. /// </summary> /// <param name="context">The context.</param> /// <param name="router">The router.</param> /// <param name="session">The user session.</param> /// <param name="events">The event service.</param> /// <returns></returns> public async Task Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events) { // this will check the authentication session and from it emit the check session // cookie needed from JS-based signout clients. await session.EnsureSessionIdCookieAsync(); try { var endpoint = router.Find(context); if (endpoint != null) { _logger.LogInformation("Invoking IdentityServer endpoint: {endpointType} for {url}", endpoint.GetType().FullName, context.Request.Path.ToString()); var result = await endpoint.ProcessAsync(context); if (result != null) { _logger.LogTrace("Invoking result: {type}", result.GetType().FullName); await result.ExecuteAsync(context); } return; } } catch (Exception ex) { await events.RaiseAsync(new UnhandledExceptionEvent(ex)); _logger.LogCritical(ex, "Unhandled exception: {exception}", ex.Message); throw; } await _next(context); }
public async Task Invoke(HttpContext context, IEndpointRouter router) { try { var endpoint = router.Find(context); if (endpoint != null) { _logger.LogInformation("Invoking WechatPay endpoint: {endpointType} for {url}", endpoint.GetType().FullName, context.Request.Path.ToString()); var result = endpoint.Process(context); if (result != null) { _logger.LogTrace("Invoking result: {type}", result.GetType().FullName); await result.ExecuteAsync(context); } return; } else { context.Response.StatusCode = StatusCodes.Status404NotFound; } } catch (Exception ex) { _logger.LogCritical(ex, "Unhandled exception: {exception}", ex.Message); } }
private async Task TestEndpointOfflineInner(IServiceEndpointManager manager, IEndpointRouter router, bool migratable) { var containers = new List <TestServiceConnectionContainer>(); var container = new TestMultiEndpointServiceConnectionContainer("hub", e => { var c = new TestServiceConnectionContainer(new List <IServiceConnection> { new TestSimpleServiceConnection(), new TestSimpleServiceConnection() }); c.MockOffline = true; containers.Add(c); return(c); }, manager, router, NullLoggerFactory.Instance); foreach (var c in containers) { Assert.False(c.IsOffline); } var expected = container.OfflineAsync(migratable); var actual = await Task.WhenAny( expected, Task.Delay(TimeSpan.FromSeconds(1)) ); Assert.Equal(expected, actual); foreach (var c in containers) { Assert.True(c.IsOffline); } }
protected AbstractFileListener( IQueueStrategy queueStrategy, Uri endpoint, int threadCount, IMessageSerializer messageSerializer, IEndpointRouter endpointRouter, TransactionalOptions transactional, IMessageBuilder <Message> messageBuilder) { this.queueStrategy = queueStrategy; this.messageSerializer = messageSerializer; this.endpointRouter = endpointRouter; this.endpoint = endpoint; this.threadCount = threadCount; threads = new Thread[threadCount]; switch (transactional) { case TransactionalOptions.Transactional: this.transactional = true; break; case TransactionalOptions.NonTransactional: this.transactional = false; break; case TransactionalOptions.FigureItOut: this.transactional = null; break; default: throw new ArgumentOutOfRangeException("transactional"); } this.messageBuilder = messageBuilder; this.messageBuilder.Initialize(Endpoint); }
public MockServiceHubDispatcher( IServiceProtocol serviceProtocol, IHubContext <THub> context, IServiceConnectionManager <THub> serviceConnectionManager, IClientConnectionManager clientConnectionManager, IServiceEndpointManager serviceEndpointManager, IOptions <ServiceOptions> options, ILoggerFactory loggerFactory, IEndpointRouter router, IServerNameProvider nameProvider, ServerLifetimeManager serverLifetimeManager, IClientConnectionFactory clientConnectionFactory) : base( serviceProtocol, context, serviceConnectionManager, clientConnectionManager, serviceEndpointManager, options, loggerFactory, router, nameProvider, serverLifetimeManager, clientConnectionFactory, null) { MockService = new ConnectionTrackingMockService(); // just store copies of these locally to keep the base class' accessor modifiers intact _loggerFactory = loggerFactory; _clientConnectionManager = clientConnectionManager; _serviceProtocol = serviceProtocol; _clientConnectionFactory = clientConnectionFactory; }
public RhinoQueuesTransport( Uri endpoint, IEndpointRouter endpointRouter, IMessageSerializer messageSerializer, int threadCount, string path, IsolationLevel queueIsolationLevel, int numberOfRetries) { this.endpoint = endpoint; this.queueIsolationLevel = queueIsolationLevel; this.numberOfRetries = numberOfRetries; this.endpointRouter = endpointRouter; this.messageSerializer = messageSerializer; this.threadCount = threadCount; this.path = path; queueName = endpoint.GetQueueName(); threads = new Thread[threadCount]; // This has to be the first subscriber to the transport events // in order to successfuly handle the errors semantics new ErrorAction(numberOfRetries).Init(this); }
public EventListenerMiddleware( ILogger <EventListenerMiddleware> logger, IEndpointRouter endpointRouter) { _logger = logger; _endpointRouter = endpointRouter; }
public ServiceManagerStore(IConfiguration configuration, ILoggerFactory loggerFactory, AzureComponentFactory azureComponentFactory, IEndpointRouter router = null) { this.loggerFactory = loggerFactory; _azureComponentFactory = azureComponentFactory; this.configuration = configuration; this.router = router; }
public NegotiateHandler( IOptions <HubOptions> globalHubOptions, IOptions <HubOptions <THub> > hubOptions, IServiceEndpointManager endpointManager, IEndpointRouter router, IUserIdProvider userIdProvider, IServerNameProvider nameProvider, IConnectionRequestIdProvider connectionRequestIdProvider, IOptions <ServiceOptions> options, IBlazorDetector blazorDetector, ILogger <NegotiateHandler <THub> > logger) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _endpointManager = endpointManager ?? throw new ArgumentNullException(nameof(endpointManager)); _router = router ?? throw new ArgumentNullException(nameof(router)); _serverName = nameProvider?.GetName(); _userIdProvider = userIdProvider ?? throw new ArgumentNullException(nameof(userIdProvider)); _connectionRequestIdProvider = connectionRequestIdProvider ?? throw new ArgumentNullException(nameof(connectionRequestIdProvider)); _claimsProvider = options?.Value?.ClaimsProvider; _diagnosticClientFilter = options?.Value?.DiagnosticClientFilter; _blazorDetector = blazorDetector ?? new DefaultBlazorDetector(); _mode = options.Value.ServerStickyMode; _enableDetailedErrors = globalHubOptions.Value.EnableDetailedErrors == true; _endpointsCount = options.Value.Endpoints.Length; _maxPollInterval = options.Value.MaxPollIntervalInSeconds; _transportTypeDetector = options.Value.TransportTypeDetector; _customHandshakeTimeout = GetCustomHandshakeTimeout(hubOptions.Value.HandshakeTimeout ?? globalHubOptions.Value.HandshakeTimeout); _hubName = typeof(THub).Name; }
public RhinoQueuesTransport(Uri endpoint, IEndpointRouter endpointRouter, IMessageSerializer messageSerializer, int threadCount, string path, IsolationLevel queueIsolationLevel, int numberOfRetries, bool enablePerformanceCounters, IMessageBuilder <MessagePayload> messageBuilder, QueueManagerConfiguration queueManagerConfiguration, ITransactionStrategy transactionStrategy) { this.endpoint = endpoint; this.queueIsolationLevel = queueIsolationLevel; this.numberOfRetries = numberOfRetries; this.enablePerformanceCounters = enablePerformanceCounters; this.messageBuilder = messageBuilder; this.queueManagerConfiguration = queueManagerConfiguration; this.transactionStrategy = transactionStrategy; this.endpointRouter = endpointRouter; this.messageSerializer = messageSerializer; this.threadCount = threadCount; this.path = path; queueName = endpoint.GetQueueName(); threads = new Thread[threadCount]; // This has to be the first subscriber to the transport events // in order to successfully handle the errors semantics new ErrorAction(numberOfRetries).Init(this); messageBuilder.Initialize(this.Endpoint); }
public SqlQueuesTransport(Uri queueEndpoint, IEndpointRouter endpointRouter, IMessageSerializer messageSerializer, int threadCount, string connectionString, int numberOfRetries, IMessageBuilder <MessagePayload> messageBuilder) { this.queueEndpoint = queueEndpoint; this.numberOfRetries = numberOfRetries; this.messageBuilder = messageBuilder; this.endpointRouter = endpointRouter; this.messageSerializer = messageSerializer; this.threadCount = threadCount; this.connectionString = connectionString; queueName = queueEndpoint.GetQueueName(); threads = new Thread[threadCount]; // This has to be the first subscriber to the transport events // in order to successfuly handle the errors semantics new ErrorAction(numberOfRetries).Init(this); messageBuilder.Initialize(Endpoint); }
public MessageOwnersSelector( MessageOwner[] messageOwners, IEndpointRouter endpointRouter) { this.messageOwners = messageOwners; this.endpointRouter = endpointRouter; }
public RhinoFilesTransport(Uri endpoint, IEndpointRouter endpointRouter, IMessageSerializer messageSerializer, int threadCount, string path, IsolationLevel queueIsolationLevel, int numberOfRetries, bool enablePerformanceCounters, IMessageBuilder<MessagePayload> messageBuilder, QueueManagerConfiguration queueManagerConfiguration) { _endpoint = endpoint; _queueIsolationLevel = queueIsolationLevel; _numberOfRetries = numberOfRetries; _enablePerformanceCounters = enablePerformanceCounters; _messageBuilder = messageBuilder; _queueManagerConfiguration = queueManagerConfiguration; _endpointRouter = endpointRouter; _messageSerializer = messageSerializer; _threadCount = threadCount; _path = path; _queueName = endpoint.GetQueueName(); _threads = new Thread[threadCount]; // This has to be the first subscriber to the transport events in order to successfully handle the errors semantics new ErrorAction(numberOfRetries).Init(this); messageBuilder.Initialize(Endpoint); }
public SqlQueuesTransport(Uri queueEndpoint, IEndpointRouter endpointRouter, IMessageSerializer messageSerializer, int threadCount, string connectionString, int numberOfRetries, IMessageBuilder<MessagePayload> messageBuilder) { this.queueEndpoint = queueEndpoint; this.numberOfRetries = numberOfRetries; this.messageBuilder = messageBuilder; this.endpointRouter = endpointRouter; this.messageSerializer = messageSerializer; this.threadCount = threadCount; this.connectionString = connectionString; queueName = queueEndpoint.GetQueueName(); threads = new Thread[threadCount]; // This has to be the first subscriber to the transport events // in order to successfuly handle the errors semantics new ErrorAction(numberOfRetries).Init(this); messageBuilder.Initialize(Endpoint); }
public NegotiateHandler(IServiceEndpointManager endpointManager, IEndpointRouter router, IUserIdProvider userIdProvider, IOptions <ServiceOptions> options) { _endpointManager = endpointManager ?? throw new ArgumentNullException(nameof(endpointManager)); _router = router ?? throw new ArgumentNullException(nameof(router)); _userIdProvider = userIdProvider ?? throw new ArgumentNullException(nameof(userIdProvider)); _claimsProvider = options?.Value?.ClaimsProvider; }
/// <summary> /// Invokes the middleware. /// </summary> /// <param name="context">The context.</param> /// <param name="router">The router.</param> /// <returns></returns> public async Task Invoke(HttpContext context, IEndpointRouter router, IUserSession session) { // todo: review: right place to call this? await session.EnsureSessionIdCookieAsync(); try { var endpoint = router.Find(context); if (endpoint != null) { _logger.LogInformation("Invoking IdentityServer endpoint: {endpointType} for {url}", endpoint.GetType().FullName, context.Request.Path.ToString()); var result = await endpoint.ProcessAsync(context); if (result != null) { _logger.LogTrace("Invoking result: {type}", result.GetType().FullName); await result.ExecuteAsync(context); } return; } } catch (Exception ex) { await _events.RaiseAsync(new UnhandledExceptionEvent(ex)); _logger.LogCritical("Unhandled exception: {exception}", ex.ToString()); throw; } await _next(context); }
public MsmqTransport(IMessageSerializer serializer, IQueueStrategy queueStrategy, Uri endpoint, int threadCount, IMsmqTransportAction[] transportActions, IEndpointRouter endpointRouter, IsolationLevel queueIsolationLevel, TransactionalOptions transactional, bool consumeInTransaction) : base(queueStrategy, endpoint, threadCount, serializer, endpointRouter, transactional) { this.transportActions = transportActions; this.queueIsolationLevel = queueIsolationLevel; this.consumeInTransaction = consumeInTransaction; }
public ServiceManagerStore(IConfiguration configuration, ILoggerFactory loggerFactory, IEndpointRouter router = null) { this.loggerFactory = loggerFactory; this.configuration = configuration; this.router = router; logger = this.loggerFactory.CreateLogger <ServiceManagerStore>(); }
public async Task Invoke(HttpContext context, IEndpointRouter router) { try { var endpoint = router.Find(context); if (endpoint != null) { _logger.LogInformation("Invoking IdentityServer endpoint: {endpointType} for {url}", endpoint.GetType().FullName, context.Request.Path.ToString()); var result = await endpoint.ProcessAsync(context); if (result != null) { _logger.LogTrace("Invoking result: {type}", result.GetType().FullName); await result.ExecuteAsync(context); } return; } } catch (Exception ex) { _logger.LogCritical("Unhandled exception: {exception}", ex.ToString()); throw; } await _next(context); }
public ServiceHubDispatcher( IServiceProtocol serviceProtocol, IHubContext <THub> context, IServiceConnectionManager <THub> serviceConnectionManager, IClientConnectionManager clientConnectionManager, IServiceEndpointManager serviceEndpointManager, IOptions <ServiceOptions> options, ILoggerFactory loggerFactory, IEndpointRouter router, IServerNameProvider nameProvider, ServerLifetimeManager serverLifetimeManager, IClientConnectionFactory clientConnectionFactory, IServiceEventHandler serviceEventHandler) { _serviceProtocol = serviceProtocol; _serviceConnectionManager = serviceConnectionManager; _clientConnectionManager = clientConnectionManager; _serviceEndpointManager = serviceEndpointManager; _options = options != null ? options.Value : throw new ArgumentNullException(nameof(options)); Context = context; _router = router ?? throw new ArgumentNullException(nameof(router)); _loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory)); _logger = loggerFactory.CreateLogger <ServiceHubDispatcher <THub> >(); _clientConnectionFactory = clientConnectionFactory; _nameProvider = nameProvider; _hubName = typeof(THub).Name; _serviceEventHandler = serviceEventHandler; serverLifetimeManager?.Register(ShutdownAsync); }
public MsmqReadyForWorkListener(IQueueStrategy queueStrategy, Uri endpoint, int threadCount, IMessageSerializer messageSerializer, IEndpointRouter endpointRouter, TransactionalOptions transactional, IMessageBuilder<Message> messageBuilder) : base(queueStrategy, endpoint, threadCount, messageSerializer, endpointRouter, transactional, messageBuilder) {}
public MsmqReadyForWorkListener(IQueueStrategy queueStrategy, Uri endpoint, int threadCount, IMessageSerializer messageSerializer, IEndpointRouter endpointRouter, TransactionalOptions transactional) : base(queueStrategy, endpoint, threadCount, messageSerializer, endpointRouter, transactional) { }
public DistributedHashTable( string database, Uri url, IEndpointRouter endpointRouter, IServiceBus bus) : this(database, url, endpointRouter, bus, null) { }
public MultiEndpointConnectionContainerFactory(IServiceConnectionFactory connectionFactory, ILoggerFactory loggerFactory, IServiceEndpointManager serviceEndpointManager, IOptions <ContextOptions> options, IEndpointRouter router = null) { _connectionFactory = connectionFactory; _loggerFactory = loggerFactory; _endpointManager = serviceEndpointManager; _connectionCount = options.Value.ConnectionCount; _router = router; }
public TestMultiEndpointServiceConnectionContainer(string hub, Func <HubServiceEndpoint, IServiceConnectionContainer> generator, IServiceEndpointManager endpoint, IEndpointRouter router, ILoggerFactory loggerFactory ) : base(hub, generator, endpoint, router, loggerFactory) { }
public NegotiateHandler(IServiceEndpointManager endpointManager, IEndpointRouter router, IUserIdProvider userIdProvider, IServerNameProvider nameProvider, IOptions <ServiceOptions> options) { _endpointManager = endpointManager ?? throw new ArgumentNullException(nameof(endpointManager)); _router = router ?? throw new ArgumentNullException(nameof(router)); _serverName = nameProvider?.GetName(); _userIdProvider = userIdProvider ?? throw new ArgumentNullException(nameof(userIdProvider)); _claimsProvider = options?.Value?.ClaimsProvider; _mode = options.Value.ServerStickyMode; }
public NegotiateMiddleware(OwinMiddleware next, HubConfiguration configuration, string appName, IServiceEndpointManager endpointManager, IEndpointRouter router, ServiceOptions options, ILoggerFactory loggerFactory) : base(next) { _provider = configuration.Resolver.Resolve <IUserIdProvider>(); _appName = appName ?? throw new ArgumentNullException(nameof(appName)); _claimsProvider = options?.ClaimsProvider; _endpointManager = endpointManager ?? throw new ArgumentNullException(nameof(endpointManager)); _router = router ?? throw new ArgumentNullException(nameof(router)); _logger = loggerFactory?.CreateLogger <NegotiateMiddleware>() ?? throw new ArgumentNullException(nameof(loggerFactory)); }
public MsmqLoadBalancer( IMessageSerializer serializer, IQueueStrategy queueStrategy, IEndpointRouter endpointRouter, Uri endpoint, int threadCount) : base(queueStrategy, endpoint, threadCount, serializer, endpointRouter) { heartBeatTimer = new Timer(SendHeartBeatToSecondaryServer); this.queueStrategy = queueStrategy; }
public MsmqLoadBalancer( IMessageSerializer serializer, IQueueStrategy queueStrategy, IEndpointRouter endpointRouter, Uri endpoint, int threadCount, Uri secondaryLoadBalancer) : this(serializer ,queueStrategy, endpointRouter,endpoint, threadCount) { this.secondaryLoadBalancer = secondaryLoadBalancer; }
public MsmqLoadBalancer( IMessageSerializer serializer, IQueueStrategy queueStrategy, IEndpointRouter endpointRouter, Uri endpoint, int threadCount, TransactionalOptions transactional) : base(queueStrategy, endpoint, threadCount, serializer, endpointRouter, transactional) { heartBeatTimer = new Timer(SendHeartBeatToSecondaryServer); this.queueStrategy = queueStrategy; }
public MsmqLoadBalancer( IMessageSerializer serializer, IQueueStrategy queueStrategy, IEndpointRouter endpointRouter, Uri endpoint, int threadCount, Uri secondaryLoadBalancer, TransactionalOptions transactional) : this(serializer, queueStrategy, endpointRouter, endpoint, threadCount, transactional) { this.secondaryLoadBalancer = secondaryLoadBalancer; }
public NegotiateHandler( IOptions <HubOptions> hubOptions, IServiceEndpointManager endpointManager, IEndpointRouter router, IUserIdProvider userIdProvider, IServerNameProvider nameProvider, IConnectionRequestIdProvider connectionRequestIdProvider, IOptions <ServiceOptions> options) { _endpointManager = endpointManager ?? throw new ArgumentNullException(nameof(endpointManager)); _router = router ?? throw new ArgumentNullException(nameof(router)); _serverName = nameProvider?.GetName(); _userIdProvider = userIdProvider ?? throw new ArgumentNullException(nameof(userIdProvider)); _connectionRequestIdProvider = connectionRequestIdProvider ?? throw new ArgumentNullException(nameof(connectionRequestIdProvider)); _claimsProvider = options?.Value?.ClaimsProvider; _mode = options.Value.ServerStickyMode; _enableDetailedErrors = hubOptions.Value.EnableDetailedErrors == true; }
public MsmqSecondaryLoadBalancer( IMessageSerializer serializer, IQueueStrategy queueStrategy, IEndpointRouter endpointRouter, Uri endpoint, Uri primaryLoadBalancer, int threadCount) : base(serializer, queueStrategy, endpointRouter, endpoint, threadCount) { TimeoutForHeartBeatFromPrimary = TimeSpan.FromSeconds(10); this.primaryLoadBalancer = primaryLoadBalancer; tookOverWork = false; }
public MsmqLoadBalancer( IMessageSerializer serializer, IQueueStrategy queueStrategy, IEndpointRouter endpointRouter, Uri endpoint, int threadCount, Uri secondaryLoadBalancer, TransactionalOptions transactional, IMessageBuilder<Message> messageBuilder) : this(serializer, queueStrategy, endpointRouter, endpoint, threadCount, transactional, messageBuilder) { this.secondaryLoadBalancer = secondaryLoadBalancer; }
public MsmqLoadBalancer( IMessageSerializer serializer, IQueueStrategy queueStrategy, IEndpointRouter endpointRouter, Uri endpoint, int threadCount, TransactionalOptions transactional, IMessageBuilder<Message> messageBuilder) : base(queueStrategy, endpoint, threadCount, serializer, endpointRouter, transactional, messageBuilder) { heartBeatTimer = new Timer(SendHeartBeatToSecondaryServer); this.queueStrategy = queueStrategy; }
public MsmqSecondaryLoadBalancer( IMessageSerializer serializer, IQueueStrategy queueStrategy, IEndpointRouter endpointRouter, Uri endpoint, Uri primaryLoadBalancer, int threadCount, TransactionalOptions transactional) : base(serializer, queueStrategy, endpointRouter, endpoint, threadCount, transactional) { TimeoutForHeartBeatFromPrimary = TimeSpan.FromSeconds(10); this.primaryLoadBalancer = primaryLoadBalancer; tookOverWork = false; }
public MsmqSubscriptionStorage( IReflection reflection, IMessageSerializer messageSerializer, Uri queueBusListensTo, IEndpointRouter endpointRouter, IQueueStrategy queueStrategy ) { this.reflection = reflection; this.messageSerializer = messageSerializer; this.endpointRouter = endpointRouter; this.queueStrategy = queueStrategy; this.subscriptionQueue = this.queueStrategy.CreateSubscriptionQueueUri(queueBusListensTo); }
protected AbstractMsmqListener( IQueueStrategy queueStrategy, Uri endpoint, int threadCount, IMessageSerializer messageSerializer, IEndpointRouter endpointRouter) { this.queueStrategy = queueStrategy; this.messageSerializer = messageSerializer; this.endpointRouter = endpointRouter; this.endpoint = endpoint; this.threadCount = threadCount; threads = new Thread[threadCount]; }
public NegotiateMiddleware(OwinMiddleware next, HubConfiguration configuration, string appName, IServiceEndpointManager endpointManager, IEndpointRouter router, ServiceOptions options, IServerNameProvider serverNameProvider, IConnectionRequestIdProvider connectionRequestIdProvider, ILoggerFactory loggerFactory) : base(next) { _configuration = configuration; _provider = configuration.Resolver.Resolve <IUserIdProvider>(); _appName = appName ?? throw new ArgumentNullException(nameof(appName)); _claimsProvider = options?.ClaimsProvider; _endpointManager = endpointManager ?? throw new ArgumentNullException(nameof(endpointManager)); _router = router ?? throw new ArgumentNullException(nameof(router)); _connectionRequestIdProvider = connectionRequestIdProvider ?? throw new ArgumentNullException(nameof(connectionRequestIdProvider)); _logger = loggerFactory?.CreateLogger <NegotiateMiddleware>() ?? throw new ArgumentNullException(nameof(loggerFactory)); _serverName = serverNameProvider?.GetName(); _mode = options.ServerStickyMode; _enableDetailedErrors = configuration.EnableDetailedErrors; }
public MultiEndpointServiceConnectionContainerFactory( IServiceConnectionFactory serviceConnectionFactory, IServiceEndpointManager serviceEndpointManager, IEndpointRouter router, IOptions <ServiceOptions> options, IServerNameProvider nameProvider, ILoggerFactory loggerFactory) { _loggerFactory = loggerFactory; _router = router ?? throw new ArgumentNullException(nameof(router)); _serviceConnectionFactory = serviceConnectionFactory; _nameProvider = nameProvider; _options = options?.Value; _serviceEndpointManager = serviceEndpointManager ?? throw new ArgumentNullException(nameof(serviceEndpointManager)); }
public async Task Invoke(HttpContext context, IEndpointRouter router, IdentityServerContext idSvrContext) { var endpoint = router.Find(context); if (endpoint != null) { var result = await endpoint.ProcessAsync(idSvrContext); if (result != null) { await result.ExecuteAsync(idSvrContext); } return; } await _next(context); }
public RequestReplyMessageOwnersSelector(MessageOwner[] messageOwners, IEndpointRouter endpointRouter) : base(messageOwners, endpointRouter) { this.messageOwners = messageOwners; this.endpointRouter = endpointRouter; }
public MessageLoggingModule(IEndpointRouter endpointRouter, Uri logQueue) { logEndpoint = endpointRouter.GetRoutedEndpoint(logQueue); }
/// <summary> /// Initializes a new instance of the <see cref="FlatQueueStrategy"/> class. /// </summary> public FlatQueueStrategy(IEndpointRouter endpointRouter, Uri endpoint) { this.endpointRouter = endpointRouter; this.endpoint = endpoint; }
public MsmqTransport(IMessageSerializer serializer, IQueueStrategy queueStrategy, Uri endpoint, int threadCount, IMsmqTransportAction[] transportActions, IEndpointRouter endpointRouter, IsolationLevel queueIsolationLevel) : base(queueStrategy,endpoint, threadCount, serializer,endpointRouter) { this.transportActions = transportActions; this.queueIsolationLevel = queueIsolationLevel; }
public LoadBalancerMessageModule(Uri loadBalancerEndpoint, IEndpointRouter endpointRouter) { this.loadBalancerEndpoint = loadBalancerEndpoint; this.endpointRouter = endpointRouter; }
public MessageLoggingModule(IMessageSerializer messageSerializer, IEndpointRouter endpointRouter, Uri logQueue) { this.messageSerializer = messageSerializer; this.endpointRouter = endpointRouter; this.logQueue = logQueue; }