public Subscriber(IBusFactory busFactory, Settings settings) : base(busFactory, settings) { jsonSettings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }; }
public static void InitEventing( this IBusFactory factory, IEnumerable <KeyValuePair <Type, Func <object> > > eventConsumers, Action <ServiceBusConfigurator> moreConfig = null) { factory.Set(Settings.Default.ReadModelQueue, eventConsumers, moreConfig: moreConfig); }
public MyService(IBusFactory busFactory , IMessageAuditStore auditStore ) { _busFactory = busFactory ?? throw new ArgumentNullException(nameof(busFactory)); _auditStore = auditStore; }
static IBusControl Build(IBusFactory factory, IBusConfiguration busConfiguration, IEnumerable <ValidationResult> validationResult) { if (LogContext.Current == null) { LogContext.ConfigureCurrentLogContext(); } busConfiguration.HostConfiguration.LogContext = LogContext.Current; var result = BusConfigurationResult.CompileResults(validationResult); try { var busReceiveEndpointConfiguration = factory.CreateBusEndpointConfiguration(x => x.ConfigureConsumeTopology = false); var host = busConfiguration.HostConfiguration.Build(); var bus = new MassTransitBus(host, busConfiguration.BusObservers, busReceiveEndpointConfiguration); TaskUtil.Await(() => busConfiguration.BusObservers.PostCreate(bus)); return(bus); } catch (Exception ex) { TaskUtil.Await(() => busConfiguration.BusObservers.CreateFaulted(ex)); throw new ConfigurationException(result, "An exception occurred during bus creation", ex); } }
public RabbitPublisher( IBusFactory busFactory, ILogger <RabbitPublisher <T> > logger) { this.busFactory = busFactory; this.logger = logger; }
public static void InitSagas( this IBusFactory factory, IEnumerable <Type> sagas = null, Action <ServiceBusConfigurator> moreConfig = null) { factory.Set(Settings.Default.SagaQueue, sagas: sagas, moreConfig: moreConfig); }
public LPCClient( IBusFactory busFactory) { _bus = busFactory.Create(new BusOptions { EnvelopName = Consts.BusEnvelopNames.LPCServer }); }
public StreamProcessor(IBusFactory busFactory, IAwsClientFactory awsClientFactory, IAwsKinesisFactory awsKinesisFactory, IOptions <AwsSettings> awsOptions, IOptions <ServerSettings> serverOptions, IMapper mapper, ILogger <StreamProcessor> logger, IMembershipService membershipService, ICheckpointRepository checkpointRepository) { if (busFactory == null) { throw new ArgumentNullException(nameof(busFactory)); } if (awsClientFactory == null) { throw new ArgumentNullException("awsClientFactory"); } if (awsOptions == null) { throw new ArgumentNullException(nameof(awsOptions)); } if (serverOptions == null) { throw new ArgumentNullException(nameof(serverOptions)); } if (mapper == null) { throw new ArgumentNullException(nameof(mapper)); } _eventBus = busFactory.CreateEventsBus(); _kinesisFactory = awsKinesisFactory; _mapper = mapper; _logger = logger; _membershipService = membershipService; _serverSettings = serverOptions.Value; _checkpointRepository = checkpointRepository; var processedMeasurementStreamWriter = _kinesisFactory.CreateWriter(); var recordProcessingFactory = new RecordProcessorFactory(membershipService, logger); _rawMeasurementsStreamReader = _kinesisFactory.CreateReader( recordProcessingFactory, _checkpointRepository, processedMeasurementStreamWriter); // Handle processed measurements. // Read from the processed measurements stream and publish out to // EasyNetQ/RabbitQ. This should be removed once // all other services (Web/MQTT/Notifier/Membership) are getting measurements // from the processed stream rather than the queue _processedMeasurementsStreamReader = _kinesisFactory.CreateProcesssedMeasurementsReader( _checkpointRepository, _eventBus); }
public static void InitCommanding( this IBusFactory factory, IEnumerable <KeyValuePair <Type, Func <object> > > commandConsumers, Action <ServiceBusConfigurator> moreConfig = null) { factory.Set(Settings.Default.RequestQueue, commandConsumers, moreConfig: moreConfig); factory.Set(Settings.Default.ResponseQueue, moreConfig: moreConfig); }
public RabbitSubscriber( IBusFactory busFactory, ILogger <RabbitSubscriber <T> > logger, ILogger <SubscriptionResult> subscriptionLogger) { this.busFactory = busFactory; this.logger = logger; this.subscriptionLogger = subscriptionLogger; }
public Messaging(IBusFactory busFactory, Settings settings) { advancedBus = new Lazy <IAdvancedBus>(() => busFactory.CreateBus(settings).Advanced); InitializeEventMessaging(settings); InitializeCommandMessaging(settings); managementClient = new Lazy <IManagementClient>(() => new ManagementClient(settings.ManagementUrl, settings.ManagementUsername, settings.ManagementPassword)); }
public MessageReciever(IBusFactory busFactory, IJsonTranslationService translationService) { this.translationService = translationService; var connectionDetails = new BusConnectionDetails("localhost"); var syncRecieve = SubscriberDetails.Create<SyncronousMessageRequest, SyncronousMessageResponse>(SyncRecieve); var asyncRecieve = SubscriberDetails.Create<AsyncronousMessageRequest>(AsyncRecieve); busFactory.BootstrapService(connectionDetails, syncRecieve, asyncRecieve ); }
public HeartbeatService(IBusFactory busFactory, IOptions <ServerSettings> serverOptions, ILogger <HeartbeatService> logger) { _logger = logger; _bus = busFactory.CreateEventsBus(); _serverSettings = serverOptions.Value; _timer = new Timer(OnTimerTick, null, TimerIntervalSeconds * 1000, TimerIntervalSeconds * 1000); }
public CustomerServiceReciever(IBusFactory busFactory, IJsonTranslationService translationService) { this.translationService = translationService; var connectionDetails = new BusConnectionDetails("localhost"); var getCustomerDetails = SubscriberDetails.Create<CustomerIdentifier, Customer>(GetCustomer); var testDetails = SubscriberDetails.Create<string, string>(Test); var addCustomerDetails = SubscriberDetails.Create<Customer>(AddCustomer); busFactory.BootstrapService(connectionDetails, getCustomerDetails, addCustomerDetails, testDetails); }
public MembershipService(IBusFactory busFactory, IMeasurementUserPropertiesRepository measurementUserPropertiesRepository, IMapper mapper, ILogger <MembershipService> logger) { if (busFactory == null) { throw new ArgumentNullException("busFactory"); } _bus = busFactory.CreateRpcBus(); _measurementUserPropertiesRepository = measurementUserPropertiesRepository; _mapper = mapper; _logger = logger; }
public LPCServer( ILogger <LPCServer> logger, IBusFactory busFactory, IServiceProvider serviceProvider) { _logger = logger; _serviceProvider = serviceProvider; _bus = busFactory.Create(new BusOptions { EnvelopName = Consts.BusEnvelopNames.LPCServer }); }
public void Initialize(IBusFactory busFactoryToUse) { Console.WriteLine("Purging {0}, just to be sure", TimeoutService.DefaultInputQueueName); MsmqUtil.PurgeQueue(TimeoutService.DefaultInputQueueName); //var sqlServerTimeoutStorage = new SqlServerTimeoutStorage(SqlServerFixtureBase.ConnectionString, "rebus_timeouts").EnsureTableIsCreated(); //var mongoDbTimeoutStorage = new MongoDbTimeoutStorage(MongoDbFixtureBase.ConnectionString, "timeouts"); var inMemoryTimeoutStorage = new InMemoryTimeoutStorage(); timeoutService = new TimeoutService(inMemoryTimeoutStorage); timeoutService.Start(); busFactory = busFactoryToUse; }
public static IBusControl Build(this IBusFactory factory) { ConfigurationResult result = BusConfigurationResult.CompileResults(factory.Validate()); try { return(factory.CreateBus()); } catch (Exception ex) { throw new ConfigurationException(result, "An exception occurred during bus creation", ex); } }
public static IBusControl Build(this IBusFactory factory, IEnumerable <ISpecification> dependencies) { IEnumerable <ValidationResult> validationResult = factory.Validate() .Concat(dependencies.SelectMany(x => x.Validate())); var result = BusConfigurationResult.CompileResults(validationResult); try { return(factory.CreateBus()); } catch (Exception ex) { throw new ConfigurationException(result, "An exception occurred during bus creation", ex); } }
public MessageProcessorFactory(IBusFactory busFactory, IProcessingHandler <ProcessingMessage> messageProcessingHandler) { this.messageProcessingHandler = messageProcessingHandler; this.busFactory = busFactory; }
public RabbitMqBus(ILogger <RabbitMqBus> logger, IBusFactory busFactory) { _logger = logger; _busFactory = busFactory; }
public static IBusControl Build(this IBusFactory factory, IBusConfiguration busConfiguration) { return(Build(factory, busConfiguration, factory.Validate())); }
public static IServiceBus SagaQueue(this IBusFactory factory) { return(factory.Get(Settings.Default.SagaQueue)); }
public static IServiceBus ResponseQueue(this IBusFactory factory) { return(factory.Get(Settings.Default.ResponseQueue)); }
public ContainerRegistration(IBusFactory busFactory) { this.busFactory = busFactory; }
public void Initialize(IBusFactory busFactoryToUse) { busFactory = busFactoryToUse; }
private IMessageProcessorFactory GetMessageProcessorFactory(RabbitMqConfiguration configuration, IBusFactory busFactory) { IProcessingHandler <ProcessingMessage> messageProcessorHandler = new ServerMessageProcessingHandler(configuration); return(new MessageProcessorFactory(busFactory, messageProcessorHandler)); }
private IFileWatcherFactory GetFileInfoProcessingHandler(RabbitMqConfiguration configuration, IBusFactory busFactory) { var observableFileWatcher = new ObservableFileSystemWatcher(); var rxSchedulerService = new RxSchedulerService(); var serverSendContentFile = new ServerSendContentToClientHandler(busFactory.PublisherBus); IProcessingHandler <FileInfo> processorHandler = new ServerFileInfoProcessingHandler(configuration, serverSendContentFile); return(new FileWatcherFactory(observableFileWatcher, rxSchedulerService, processorHandler)); }
public static IBus CreateUseRabbitMq(this IBusFactory factory) { return(RabbitMqBusFactory.Create()); }
public static IBusControl Build(this IBusFactory factory) { return(factory.Build(Enumerable.Empty <ISpecification>())); }
public static IBusControl Build(this IBusFactory factory, IBusConfiguration busConfiguration, IEnumerable <ISpecification> dependencies) { return(Build(factory, busConfiguration, factory.Validate() .Concat(dependencies.SelectMany(x => x.Validate())))); }
public Publisher(IBusFactory busFactory, Settings settings) : base(busFactory, settings) { jsonSettings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver(), ReferenceLoopHandling = ReferenceLoopHandling.Serialize }; }
public void Initialize(IBusFactory busFactoryToUse) { timeoutService = new TimeoutService(new InMemoryTimeoutStorage()); timeoutService.Start(); busFactory = busFactoryToUse; }
public MessageSender(IBusFactory busFactory, IConsulService consulService, IContractInitializationService contractInitializationService) { this.busFactory = busFactory; this.consulService = consulService; this.contractInitializationService = contractInitializationService; }