The return of the recurrent payment tool (#126)

Co-authored-by: Inal Arsanukaev <inalarsanukaev@MacBook-Pro-Inal.local>
This commit is contained in:
Inal Arsanukaev 2020-05-14 14:14:58 +03:00 committed by GitHub
parent 4952e43a24
commit aab1427c49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -50,6 +50,8 @@ public class KafkaConfig {
private String bootstrapServers;
@Value("${kafka.consumer.invoicing.concurrency}")
private int concurrency;
@Value("${kafka.consumer.recurrent-payment-tool.concurrency}")
private int recPayToolConcurrency;
@Value("${kafka.consumer.party-management.concurrency}")
private int partyConcurrency;
@Value("${retry-policy.maxAttempts}")
@ -96,6 +98,12 @@ public class KafkaConfig {
return createConcurrentFactory(consumerFactory, concurrency);
}
@Bean
public KafkaListenerContainerFactory<ConcurrentMessageListenerContainer<String, MachineEvent>> recPayToolContainerFactory(
ConsumerFactory<String, MachineEvent> consumerFactory) {
return createConcurrentFactory(consumerFactory, recPayToolConcurrency);
}
@Bean
public KafkaListenerContainerFactory<ConcurrentMessageListenerContainer<String, MachineEvent>> partyManagementContainerFactory(
KafkaSslProperties kafkaSslProperties) {

View File

@ -2,8 +2,10 @@ package com.rbkmoney.newway.config;
import com.rbkmoney.newway.poller.listener.InvoicingKafkaListener;
import com.rbkmoney.newway.poller.listener.PartyManagementListener;
import com.rbkmoney.newway.poller.listener.RecurrentPaymentToolListener;
import com.rbkmoney.newway.service.InvoicingService;
import com.rbkmoney.newway.service.PartyManagementService;
import com.rbkmoney.newway.service.RecurrentPaymentToolService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -19,6 +21,12 @@ public class KafkaConsumerBeanEnableConfig {
return new InvoicingKafkaListener(invoicingService);
}
@Bean
@ConditionalOnProperty(value = "info.single-instance-mode", havingValue = "false")
public RecurrentPaymentToolListener recurrentPaymentToolListener(RecurrentPaymentToolService recurrentPaymentToolService) {
return new RecurrentPaymentToolListener(recurrentPaymentToolService);
}
@Bean
@ConditionalOnProperty(value = "info.single-instance-mode", havingValue = "false")
public PartyManagementListener partyManagementListener(PartyManagementService partyManagementService) {