fix bug
This commit is contained in:
parent
0e225d7804
commit
2b4c5fef77
2 changed files with 8 additions and 4 deletions
|
|
@ -9,6 +9,7 @@ import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||||
import ru.spcex.clearing.lim.exporter.config.SFTPConfig;
|
import ru.spcex.clearing.lim.exporter.config.SFTPConfig;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.cud.utilities.LimExportedRequest;
|
import ru.spcex.clearing.platform.messaging.domain.cud.utilities.LimExportedRequest;
|
||||||
import ru.spcex.clearing.platform.messaging.serialization.LogFormatter;
|
import ru.spcex.clearing.platform.messaging.serialization.LogFormatter;
|
||||||
|
import ru.spcex.clearing.platform.messaging.service.RequestInfoUpdate;
|
||||||
import ru.spcex.clearing.platform.messaging.service.sender.KafkaSender;
|
import ru.spcex.clearing.platform.messaging.service.sender.KafkaSender;
|
||||||
import ru.spcex.platform.enumeration.Section;
|
import ru.spcex.platform.enumeration.Section;
|
||||||
import ru.spcex.platform.enumeration.ServiceStatus;
|
import ru.spcex.platform.enumeration.ServiceStatus;
|
||||||
|
|
@ -53,7 +54,7 @@ public abstract class AbstractExporterService {
|
||||||
|
|
||||||
public abstract Section section();
|
public abstract Section section();
|
||||||
|
|
||||||
public void process() {
|
public RequestInfoUpdate process() {
|
||||||
String fileName = getTargetFileName();
|
String fileName = getTargetFileName();
|
||||||
log.debug("Start export {} Lim file", fileName);
|
log.debug("Start export {} Lim file", fileName);
|
||||||
|
|
||||||
|
|
@ -77,6 +78,7 @@ public abstract class AbstractExporterService {
|
||||||
log.debug("Successfully exported {} file", fileName);
|
log.debug("Successfully exported {} file", fileName);
|
||||||
|
|
||||||
sendLimExportedNotification(fileName);
|
sendLimExportedNotification(fileName);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendLimExportedNotification(String fileName) {
|
void sendLimExportedNotification(String fileName) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package ru.spcex.clearing.lim.exporter.services;
|
package ru.spcex.clearing.lim.exporter.services;
|
||||||
|
|
||||||
import org.apache.kafka.clients.consumer.Consumer;
|
import org.apache.kafka.clients.consumer.Consumer;
|
||||||
|
import org.apache.kafka.clients.producer.Producer;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
|
|
@ -16,9 +17,10 @@ public class LauncherCommandReceiver extends QueueConsumer implements Initializi
|
||||||
private final SecurityExporterService securityExporterService;
|
private final SecurityExporterService securityExporterService;
|
||||||
|
|
||||||
public LauncherCommandReceiver(Consumer<String, Object> kafkaQueue,
|
public LauncherCommandReceiver(Consumer<String, Object> kafkaQueue,
|
||||||
|
Producer<String, Object> kafkaProducer,
|
||||||
MoneyExporterService moneyExporterService,
|
MoneyExporterService moneyExporterService,
|
||||||
SecurityExporterService securityExporterService) {
|
SecurityExporterService securityExporterService) {
|
||||||
super(kafkaQueue);
|
super(kafkaQueue, kafkaProducer);
|
||||||
this.moneyExporterService = moneyExporterService;
|
this.moneyExporterService = moneyExporterService;
|
||||||
this.securityExporterService = securityExporterService;
|
this.securityExporterService = securityExporterService;
|
||||||
}
|
}
|
||||||
|
|
@ -26,10 +28,10 @@ public class LauncherCommandReceiver extends QueueConsumer implements Initializi
|
||||||
@Override
|
@Override
|
||||||
public void afterPropertiesSet() {
|
public void afterPropertiesSet() {
|
||||||
callback(LauncherCommandRequest.class)
|
callback(LauncherCommandRequest.class)
|
||||||
.setConsumer(action -> moneyExporterService.process())
|
.setFunction(action -> moneyExporterService.process())
|
||||||
.forDestination(Task.unloadingSession_LIMM.topic(), callbacks::put); // LIMM
|
.forDestination(Task.unloadingSession_LIMM.topic(), callbacks::put); // LIMM
|
||||||
callback(LauncherCommandRequest.class)
|
callback(LauncherCommandRequest.class)
|
||||||
.setConsumer(action -> securityExporterService.process())
|
.setFunction(action -> securityExporterService.process())
|
||||||
.forDestination(Task.unloadingSession_LIMS.topic(), callbacks::put); // LIMS
|
.forDestination(Task.unloadingSession_LIMS.topic(), callbacks::put); // LIMS
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue