Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            _client = BusClientFactory.CreateDefault(
                cfg => cfg
                    .SetBasePath(Environment.CurrentDirectory)
                    .AddJsonFile("rawrabbit.json"),
                ioc => ioc
                    .AddSingleton<IConfigurationEvaluator, AttributeConfigEvaluator>()
                );

            _client.SubscribeAsync<ValuesRequested>(ServeValuesAsync);
            _client.RespondAsync<ValueRequest, ValueResponse>(SendValuesThoughRpcAsync);
        }
 public OrderCreatedSubscription(ILogger log, IBusClient busClient)
 {
     this.log       = log;
     this.busClient = busClient;
 }
Ejemplo n.º 3
0
 public FibonacciController(IBusClient busClient, IRepository repository)
 {
     _busClient  = busClient;
     _repository = repository;
 }
Ejemplo n.º 4
0
 public EventPublisher(IBusClient bus)
 => _bus = bus;
 public AccountController(IAuthenticateService authenticateService, IBusClient busClient)
 {
     _authenticateService = authenticateService;
     _busClient           = busClient;
 }
 public static ISubscription SubscribeToCommand <TCommand>(this IBusClient bus,
                                                           ICommandHandler <TCommand> handler, string name = null) where TCommand : ICommand
 {
     return(bus.SubscribeAsync <TCommand>(async(msg, context) => await handler.HandleAsync(msg),
                                          cfg => cfg.WithQueue(q => q.WithName(GetExchangeName <TCommand>(name)))));
 }
Ejemplo n.º 7
0
 public ActivitiesController(IBusClient busClient)
 {
     _busClient = busClient;
 }
Ejemplo n.º 8
0
 public ProjectRepository(IEventStore eventStore, IBusClient bus) : base(eventStore, bus)
 {
 }
 public RequestNewOrganizationHandler(IBusClient bus, IUserFeaturesManager userFeaturesManager)
 {
     _bus = bus;
     _userFeaturesManager = userFeaturesManager;
 }
Ejemplo n.º 10
0
 public BusPublisher(IBusClient busClient)
 {
     _busClient = busClient;
 }
Ejemplo n.º 11
0
 public ActivityController(IBusClient bus)
 {
     _bus = bus;
 }
Ejemplo n.º 12
0
 public BuySecuritiesHandler(IPortfolioService portfolioService, IBusClient busClient)
 {
     this.portfolioService = portfolioService;
     this.busClient        = busClient;
 }
Ejemplo n.º 13
0
 public ValuesController(IBusClient busClient, ILogger <ValuesController> logger)
 {
     _busClient = busClient;
     _logger    = logger;
 }
Ejemplo n.º 14
0
 public DataController(IBusClient busClient, ILogger <SampleDataController> logger)
 {
     _busClient = busClient;
     _logger    = logger;
 }
Ejemplo n.º 15
0
 public Heartbeat(IBusClient client, int timeBetweenMsg, int maxTimeBetween, int maxMsgLost)
 {
     _client     = client;
     _publisher  = new Publisher(client, timeBetweenMsg);
     _subscriber = new Subscriber(client, maxTimeBetween, maxMsgLost);
 }
		public MessageHandlerExceptionTests()
		{
			_errorHandler = new Mock<IErrorHandlingStrategy>();
			_client = BusClientFactory.CreateDefault(null, ioc => ioc.AddSingleton(c => _errorHandler.Object));
		}
Ejemplo n.º 17
0
		public ValuesController(IBusClient busClient, ILoggerFactory loggerFactory)
		{
			_busClient = busClient;
			_logger = loggerFactory.CreateLogger<ValuesController>();
			_random = new Random();
		}
Ejemplo n.º 18
0
 public FibController(IBusClient client, IRepository repo)
 {
     _client = client;
     _repo   = repo;
 }
Ejemplo n.º 19
0
 public static Task WithCommandHandlerAsync <TCommand>(this IBusClient bus,
                                                       ICommandHandler <TCommand> handler) where TCommand : ICommand
 => bus.SubscribeAsync <TCommand>(msg => handler.HandleAsync(msg),
                                  ctx => ctx.UseSubscribeConfiguration(cfg =>
                                                                       cfg.FromDeclaredQueue(q => q.WithName(GetQueueName <TCommand>()))));
Ejemplo n.º 20
0
 public CommandDispatcher(IBusClient bus)
 {
     _bus = bus;
 }
Ejemplo n.º 21
0
 public UsersController(IBusClient busClient)
 {
     _busClient = busClient;
 }
Ejemplo n.º 22
0
 public MathController(IBusClient client, IRepository repository)
 {
     _client     = client;
     _repository = repository;
 }
Ejemplo n.º 23
0
 public static ISubscription SubscribeToEvent <TEvent>(this IBusClient bus,
                                                       IEventHandler <TEvent> handler, string name = null) where TEvent : IDomainEvent
 {
     return(bus.SubscribeAsync <TEvent>(async(msg, context) => await handler.HandleAsync(msg),
                                        cfg => cfg.WithQueue(q => q.WithName(GetExchangeName <TEvent>(name)))));
 }
        private readonly IActivityRepository activityRepository; // It's a sample. In a more realistic scenario, it should be an application service here.

        public ActivitiesController(IBusClient busClient, IActivityRepository activityRepository)
        {
            this._busClient         = busClient;
            this.activityRepository = activityRepository;
        }
 public ActivitiesController(IBusClient busClient, IActivityRepository repository)
 {
     _busClient  = busClient;
     _repository = repository;
 }
Ejemplo n.º 26
0
 public ActivitiesController(IBusClient busClient, IActivityRepository activityRepo, ILogger <ActivitiesController> logger)
 {
     _activityRepository = activityRepo;
     _busClient          = busClient;
     _logger             = logger;
 }
Ejemplo n.º 27
0
 public static Task WithEventHandlerAsync <TEvent>(this IBusClient bus,
                                                   IEventHandler <TEvent> handler) where TEvent : IEvent
 => bus.SubscribeAsync <TEvent>(msg => handler.HandleAsync(msg),
                                ctx => ctx.UseConsumerConfiguration(cfg =>
                                                                    cfg.FromDeclaredQueue(q => q.WithName(GetQueueName <TEvent>()))
                                                                    ));
Ejemplo n.º 28
0
 public BookController(IBusClient bus)
 {
     _bus = bus;
 }
Ejemplo n.º 29
0
 public BusBuilder(IWebHost webHost, IBusClient bus)
 {
     _webHost = webHost;
     _bus     = bus;
 }
Ejemplo n.º 30
0
 public RawRabbitWrapper(EventDbContext context, IBusClient rawRabbitClient, ILogger <RawRabbitWrapper> logger)
 {
     _context         = context;
     _rawRabbitClient = rawRabbitClient;
     _logger          = logger;
 }
        public BusBuilder UseRabbitMq()
        {
            _bus = (IBusClient)_webHost.Services.GetService(typeof(IBusClient));

            return(new BusBuilder(_webHost, _bus));
        }
Ejemplo n.º 32
0
 public CreateUserHandler(IBusClient busClient, ILogger <CreateUserHandler> logger, IUserService userService)
 {
     _userService = userService;
     _busClient   = busClient;
     _logger      = logger;
 }
 public CreateUserCommandHandler(IBusClient busClient)
 {
     _busClient = busClient;
 }
Ejemplo n.º 34
0
 public ScanTaskBlob(IBusClient bus, IStreamingRoot storage)
 {
     _bus = bus;
     _storage = storage;
 }