/// <summary> /// Constructs the class object. /// </summary> /// <param name="configutationRabbitMQ">The event bus configuration.</param> /// <param name="connectionFactory">The connection factory.</param> public EventBusPublishProvider(EventBusConfigutation configutationRabbitMQ, RabbitMQConnectionFactory connectionFactory) { _configutationRabbitMQ = configutationRabbitMQ; _connectionFactory = connectionFactory; _policy = RetryPolicy.Handle <SocketException>().Or <BrokerUnreachableException>() .WaitAndRetry(_configutationRabbitMQ.RecconectCount, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))); }
public EventBusSubscriberProvider(EventBusConfigutation configutationRabbitMQ, RabbitMQConnectionFactory connectionFactory, SubscriptionDelegate <TNotification> notificationDelegate) { _configutationRabbitMQ = configutationRabbitMQ; _connectionFactory = connectionFactory; _notificationDelegate = notificationDelegate; _policy = RetryPolicy.Handle <SocketException>().Or <BrokerUnreachableException>() .WaitAndRetry(_configutationRabbitMQ.RecconectCount, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))); }
public EventBusPublisherFactory(IOptions <EventBusConfigutation> configutationRabbitMQ, RabbitMQConnectionFactory connectionFactory) { _configutationRabbitMQ = configutationRabbitMQ.Value; _connectionFactory = connectionFactory; }