public ConsumeRabbitMQHostedService(IPooledObjectPolicy <IModel> objectPolicy, IConfiguration Configuration)
        {
            this.Configuration = Configuration;
            string exchangeName = "exchange";

            _objectPool   = new DefaultObjectPool <IModel>(objectPolicy, Environment.ProcessorCount * 1);
            RabbitManager = new RabbitManager(objectPolicy);
            _channel      = _objectPool.Get();
            _channel.ExchangeDeclare(exchangeName, ExchangeType.Topic, true, false);
            _channel.QueueDeclare(StaticParams.ModuleName, true, false, false, null);

            List <Type> handlerTypes = typeof(ConsumeRabbitMQHostedService).Assembly.GetTypes()
                                       .Where(x => typeof(Handler).IsAssignableFrom(x) && x.IsClass && !x.IsAbstract)
                                       .ToList();

            foreach (Type type in handlerTypes)
            {
                Handler handler = (Handler)Activator.CreateInstance(type);
                Handlers.Add(handler);
            }

            foreach (IHandler handler in Handlers)
            {
                handler.QueueBind(_channel, StaticParams.ModuleName, exchangeName);
            }
            _channel.BasicQos(0, 1, false);
        }
Esempio n. 2
0
        public SearchController(IElasticSearchService _elasticSearchService, IRabbitManager _manager)
        {
            elasticSearchService = _elasticSearchService;
            client = elasticSearchService.getClient();

            manager = _manager;
        }
Esempio n. 3
0
 public MaintenanceService(DataContext DataContext, INotificationService NotificationService, ILogging Logging, IRabbitManager RabbitManager)
 {
     this.DataContext         = DataContext;
     this.NotificationService = NotificationService;
     this.Logging             = Logging;
     this.RabbitManager       = RabbitManager;
 }
Esempio n. 4
0
 public Logging(ICurrentContext CurrentContext,
                IRabbitManager RabbitManager,
                IUOW UOW)
 {
     this.CurrentContext = CurrentContext;
     this.RabbitManager  = RabbitManager;
     this.UOW            = UOW;
 }
Esempio n. 5
0
 public BasketController(ILogger <BasketController> logger,
                         IBasketItemRepository basketItemRepository,
                         IRabbitManager manager)
 {
     this.logger = logger;
     this.basketItemRepository = basketItemRepository;
     this.manager = manager;
 }
Esempio n. 6
0
 public ReceiverOfflineMessage(
     IRabbitManager rabbitManager,
     IServiceProvider serviceProvider
     )
 {
     _rabbitManager   = rabbitManager;
     _serviceProvider = serviceProvider;
 }
Esempio n. 7
0
 public WorkflowService(IUOW UOW,
                        ICurrentContext CurrentContext,
                        IRabbitManager RabbitManager
                        )
 {
     this.UOW            = UOW;
     this.CurrentContext = CurrentContext;
     this.RabbitManager  = RabbitManager;
 }
Esempio n. 8
0
 public OrdersController(
     IDatabaseRepository databaseRepository,
     IRabbitManager rabbitManager,
     IOptions <BrokerConfigInfo> brokerOptions
     )
 {
     _ordersModel      = new OrdersModel(databaseRepository);
     _rabbitManager    = rabbitManager;
     _brokerConfigInfo = brokerOptions.Value;
 }
Esempio n. 9
0
 public ReceiverMessage(
     ILogger <ReceiverMessage> logger,
     IRabbitManager rabbitManager,
     IConfiguration configuration
     )
 {
     _logger        = logger;
     _rabbitManager = rabbitManager;
     _configuration = configuration;
 }
Esempio n. 10
0
 public ChatController(
     IChatRecordService chatRecordService,
     IRabbitManager rabbitManager,
     ICacheManager cacheManager,
     IOfflineMessageService offlineMessageService
     )
 {
     _chatRecordService     = chatRecordService;
     _rabbitManager         = rabbitManager;
     _cacheManager          = cacheManager;
     _offlineMessageService = offlineMessageService;
 }
Esempio n. 11
0
 public AuthController(ILogger <AuthController> logger,
                       IUserRepository userRepository,
                       IRabbitManager manager,
                       IRefreshTokenRepository refreshTokenRepository,
                       AuthorizationConfigs authorizationConfigs)
 {
     this.logger                 = logger;
     this.userRepository         = userRepository;
     this.manager                = manager;
     this.refreshTokenRepository = refreshTokenRepository;
     this.authorizationConfigs   = authorizationConfigs;
 }
Esempio n. 12
0
 public FriendController(
     IFriendService friendService,
     IWorkContext workContext,
     IRabbitManager rabbitManager,
     ICacheManager cacheManager
     )
 {
     _friendService = friendService;
     _workContext   = workContext;
     _rabbitManager = rabbitManager;
     _cacheManager  = cacheManager;
 }
Esempio n. 13
0
 public PayForOrderConsumer(
     IServiceScopeFactory scopeFactory,
     ILogger <PayForOrderConsumer> logger,
     IRabbitManager rabbitManager,
     IMapper mapper)
 {
     _scopeFactory  = scopeFactory;
     _logger        = logger;
     _rabbitManager = rabbitManager;
     _mapper        = mapper;
     InitRabbitMQ();
 }
 public OrdersController(
     IOrderRepository orderRepository,
     IMapper mapper,
     LinkGenerator linkGenerator,
     ILogger <OrdersController> logger,
     IRabbitManager rabbitManager)
 {
     _orderRepository = orderRepository;
     _mapper          = mapper;
     _linkGenerator   = linkGenerator;
     _logger          = logger;
     _rabbitManager   = rabbitManager;
 }
Esempio n. 15
0
 public PaymentsController(
     ILogger <PaymentsController> logger,
     IRabbitManager rabbitManager,
     IRpcClient rpcClient,
     IPaymentRepository paymentRepository,
     IMapper mapper)
 {
     _logger            = logger;
     _rabbitManager     = rabbitManager;
     _rpcClient         = rpcClient;
     _paymentRepository = paymentRepository;
     _mapper            = mapper;
 }
Esempio n. 16
0
 public OpportunityEmailService(
     IUOW UOW,
     ICurrentContext CurrentContext,
     IOpportunityEmailValidator OpportunityEmailValidator,
     IRabbitManager RabbitManager,
     ILogging Logging
     )
 {
     this.UOW                       = UOW;
     this.Logging                   = Logging;
     this.CurrentContext            = CurrentContext;
     this.RabbitManager             = RabbitManager;
     this.OpportunityEmailValidator = OpportunityEmailValidator;
 }
        public RabbitHostedService(ILogger <RabbitHostedService> logger, IRabbitManager rabbitManager, IOptions <AppSettings> options,
                                   IHubContext <PanelDataHub> hubContext, ICustomMemoryCache customMemoryCache)
        {
            this.logger            = logger;
            this.rabbitManager     = rabbitManager;
            this.hubContext        = hubContext;
            this.customMemoryCache = customMemoryCache;
            rabbitConfig           = options.Value.RabbitConfig;

            jsonSerializerOptions = new JsonSerializerOptions()
            {
                PropertyNamingPolicy = JsonNamingPolicy.CamelCase
            };
        }
Esempio n. 18
0
 public CustomerEmailHistoryService(
     IUOW UOW,
     ICurrentContext CurrentContext,
     ICustomerEmailHistoryValidator CustomerEmailHistoryValidator,
     ILogging Logging,
     IRabbitManager RabbitManager
     )
 {
     this.UOW            = UOW;
     this.Logging        = Logging;
     this.CurrentContext = CurrentContext;
     this.CustomerEmailHistoryValidator = CustomerEmailHistoryValidator;
     this.RabbitManager = RabbitManager;
 }
Esempio n. 19
0
 public CompanyEmailService(
     IUOW UOW,
     ICurrentContext CurrentContext,
     ICompanyEmailValidator CompanyEmailValidator,
     ILogging Logging,
     IRabbitManager RabbitManager
     )
 {
     this.UOW                   = UOW;
     this.Logging               = Logging;
     this.CurrentContext        = CurrentContext;
     this.CompanyEmailValidator = CompanyEmailValidator;
     this.RabbitManager         = RabbitManager;
 }
Esempio n. 20
0
 public NotificationService(
     IUOW UOW,
     ILogging Logging,
     ICurrentContext CurrentContext,
     IRabbitManager RabbitManager,
     INotificationValidator NotificationValidator
     )
 {
     this.UOW                   = UOW;
     this.Logging               = Logging;
     this.CurrentContext        = CurrentContext;
     this.RabbitManager         = RabbitManager;
     this.NotificationValidator = NotificationValidator;
 }
Esempio n. 21
0
 public CallLogService(
     IUOW UOW,
     ILogging Logging,
     ICurrentContext CurrentContext,
     ICallLogValidator CallLogValidator,
     IOrganizationService OrganizationService,
     IRabbitManager RabbitManager
     )
 {
     this.UOW                 = UOW;
     this.Logging             = Logging;
     this.CurrentContext      = CurrentContext;
     this.CallLogValidator    = CallLogValidator;
     this.RabbitManager       = RabbitManager;
     this.OrganizationService = OrganizationService;
 }
Esempio n. 22
0
 public ContractService(
     IUOW UOW,
     ILogging Logging,
     ICurrentContext CurrentContext,
     IContractValidator ContractValidator,
     IOrganizationService OrganizationService,
     IFileService FileService,
     IRabbitManager RabbitManager
     )
 {
     this.UOW                 = UOW;
     this.Logging             = Logging;
     this.CurrentContext      = CurrentContext;
     this.ContractValidator   = ContractValidator;
     this.OrganizationService = OrganizationService;
     this.FileService         = FileService;
     this.RabbitManager       = RabbitManager;
 }
Esempio n. 23
0
 public ProductService(
     IUOW UOW,
     ILogging Logging,
     ICurrentContext CurrentContext,
     INotificationService NotificationService,
     IProductValidator ProductValidator,
     IImageService ImageService,
     IRabbitManager RabbitManager
     )
 {
     this.UOW                 = UOW;
     this.Logging             = Logging;
     this.CurrentContext      = CurrentContext;
     this.NotificationService = NotificationService;
     this.ProductValidator    = ProductValidator;
     this.ImageService        = ImageService;
     this.RabbitManager       = RabbitManager;
 }
Esempio n. 24
0
 public TicketService(
     IUOW UOW,
     ILogging Logging,
     ICurrentContext CurrentContext,
     ITicketValidator TicketValidator,
     ITicketGeneratedIdService TicketGeneratedIdService,
     ITicketOfUserService TicketOfUserService,
     INotificationService NotificationService,
     IOrganizationService OrganizationService,
     IRabbitManager RabbitManager
     )
 {
     this.UOW                      = UOW;
     this.Logging                  = Logging;
     this.CurrentContext           = CurrentContext;
     this.TicketValidator          = TicketValidator;
     this.TicketGeneratedIdService = TicketGeneratedIdService;
     this.TicketOfUserService      = TicketOfUserService;
     this.NotificationService      = NotificationService;
     this.RabbitManager            = RabbitManager;
     this.OrganizationService      = OrganizationService;
 }
 public RabbitMqReservationProcessor(IRabbitManager manager)
 {
     Manager = manager;
 }
 public ProductController(ILogger <Product> logger, IRabbitManager manager)
 {
     _logger  = logger;
     _manager = manager;
 }
 public PublishController(IRabbitManager manager)
 {
     _manager = manager;
 }
        public IActionResult Post([FromServices] IRabbitManager p_Manager, [FromForm] FormObject p_Form)
        {
            p_Manager.Publish(p_Form.Text, "server.exchange", "topic", "server.queue.*");

            return(Ok());
        }
Esempio n. 29
0
 public GeneratorData(IRabbitManager rabbitManager)
 {
     _rabbitManager = rabbitManager;
 }
 public WeatherForecastController(ILogger <WeatherForecastController> logger, IRabbitManager manager)
 {
     _logger  = logger;
     _manager = manager;
 }