static void AddProducers(this IRiderRegistrationConfigurator rider) { rider.AddProducer <OrderFinishedIntegrationEvent>("order-finished"); // talvez deletar rider.AddProducer <OrderToManagerIntegrationEvent>(_kafkaConfiguration.OrdersToManager); rider.AddProducer <OrderCreatedIntegrationEvent>(_kafkaConfiguration.OrdersToProductsStockConfirmation); rider.AddProducer <OrderRollbackIntegrationEvent>(_kafkaConfiguration.OrderRollbackProducts); rider.AddProducer <StockUpdateIntegrationEvent>(_kafkaConfiguration.ManagerStockUpdate); }
/// <summary> /// Add a provider to the container for the specified message type, using a key type of Null /// The producer must be configured in the UsingKafka configuration method. /// </summary> /// <param name="configurator"></param> /// <param name="topicName">The topic name</param> /// <param name="producerConfig"></param> /// <param name="keyResolver">Key resolver</param> /// <typeparam name="T">The message type</typeparam> /// <typeparam name="TKey">The key type</typeparam> public static IKafkaProducerRegistrationConfigurator <TKey, T> AddProducer <TKey, T>(this IRiderRegistrationConfigurator configurator, string topicName, ProducerConfig producerConfig, KafkaKeyResolver <TKey, T> keyResolver) where T : class { IKafkaProducerRegistrationConfigurator <TKey, T> registration = configurator.AddProducer <TKey, T>(topicName, producerConfig); configurator.Registrar.Register <ITopicProducer <T> >(provider => new KeyedTopicProducer <TKey, T>(provider.GetRequiredService <ITopicProducer <TKey, T> >(), keyResolver)); return(registration); }
/// <summary> /// Add a provider to the container for the specified message type, using a key type of Null /// The producer must be configured in the UsingKafka configuration method. /// </summary> /// <param name="configurator"></param> /// <param name="topicName">The topic name</param> /// <param name="producerConfig"></param> /// <typeparam name="T">The message type</typeparam> public static IKafkaProducerRegistrationConfigurator <Ignore, T> AddProducer <T>(this IRiderRegistrationConfigurator configurator, string topicName, ProducerConfig producerConfig) where T : class { return(configurator.AddProducer <Ignore, T>(topicName, producerConfig, _ => default)); }
/// <summary> /// Add a provider to the container for the specified message type, using a key type of Null /// The producer must be configured in the UsingKafka configuration method. /// </summary> /// <param name="configurator"></param> /// <param name="topicName">The topic name</param> /// <param name="configure"></param> /// <typeparam name="T">The message type</typeparam> public static void AddProducer <T>(this IRiderRegistrationConfigurator configurator, string topicName, Action <IRiderRegistrationContext, IKafkaProducerConfigurator <Null, T> > configure = null) where T : class { configurator.AddProducer(topicName, _ => default, configure);
static void AddProducers(this IRiderRegistrationConfigurator rider) { rider.AddProducer <ProductCreatedIntegrationEvent>(_kafkaConfiguration.ManagerToProductsCreate); rider.AddProducer <ProductUpdatedIntegrationEvent>(_kafkaConfiguration.ManagerToProductsUpdate); rider.AddProducer <ProductDeletedIntegrationEvent>(_kafkaConfiguration.ManagerToProductsDelete); }
private static void AddProducers(this IRiderRegistrationConfigurator rider) { rider.AddProducer <StockConfirmationIntegrationEvent>(_kafkaConfiguration.ProductsStockResponseSuccess); rider.AddProducer <StockConfirmationFailIntegrationEvent>(_kafkaConfiguration.ProductsStockResponseFail); rider.AddProducer <ProductRollbackIntegrationEvent>(_kafkaConfiguration.ManagerRollbackProducts); }