From 2a6d4e38b9890be91c2f16b8ac77fd9303af93a3 Mon Sep 17 00:00:00 2001 From: psemenkov Date: Thu, 4 May 2023 13:18:41 +0300 Subject: [PATCH] =?UTF-8?q?http://jira.mfd.msk:8088/browse/CLS-262=20?= =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BB=20=D0=BD=D0=BE=D0=B2=D1=8B?= =?UTF-8?q?=D0=B9=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clearing-parent/lim-exporter/pom.xml | 109 ++++++++++++++++++ .../lim/exporter/LimExportApplication.java | 18 +++ .../settings/ExportLimServiceSettings.java | 50 ++++++++ .../lim/exporter/config/settings/Store.java | 14 +++ .../src/main/resources/application.properties | 18 +++ .../src/main/resources/logback.xml | 37 ++++++ clearing-parent/pom.xml | 1 + 7 files changed, 247 insertions(+) create mode 100644 clearing-parent/lim-exporter/pom.xml create mode 100644 clearing-parent/lim-exporter/src/main/java/ru/clearing/lim/exporter/LimExportApplication.java create mode 100644 clearing-parent/lim-exporter/src/main/java/ru/clearing/lim/exporter/config/settings/ExportLimServiceSettings.java create mode 100644 clearing-parent/lim-exporter/src/main/java/ru/clearing/lim/exporter/config/settings/Store.java create mode 100644 clearing-parent/lim-exporter/src/main/resources/application.properties create mode 100644 clearing-parent/lim-exporter/src/main/resources/logback.xml diff --git a/clearing-parent/lim-exporter/pom.xml b/clearing-parent/lim-exporter/pom.xml new file mode 100644 index 000000000..879ff7543 --- /dev/null +++ b/clearing-parent/lim-exporter/pom.xml @@ -0,0 +1,109 @@ + + 4.0.0 + lim-exporter + Lim exporter + SPCEX-1.0.0.0 + jar + + + ru.spcex.clearing + clearing-parent + SPCEX-1.0.0.0 + + + + 17 + 17 + UTF-8 + + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.integration + spring-integration-sftp + + + + + ru.spcex.clearing + classes + SPCEX-1.0.0.0 + compile + + + ru.spcex.platform + platform-messaging + + + ru.spcex.platform + platform-imdg-api-hazelcast-impl + + + ru.spcex.platform + platform-enum + + + + + org.springframework.boot + spring-boot-starter-test + test + + + ru.spcex.clearing + test-clearing + test + + + + + + + src/main/resources + + application.properties + + false + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + ${project.artifactId} + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.21.0 + + + org.junit.platform + junit-platform-surefire-provider + 1.2.0-M1 + + + org.junit.jupiter + junit-jupiter-engine + 5.2.0-M1 + + + + + + + diff --git a/clearing-parent/lim-exporter/src/main/java/ru/clearing/lim/exporter/LimExportApplication.java b/clearing-parent/lim-exporter/src/main/java/ru/clearing/lim/exporter/LimExportApplication.java new file mode 100644 index 000000000..9a6c8f8a2 --- /dev/null +++ b/clearing-parent/lim-exporter/src/main/java/ru/clearing/lim/exporter/LimExportApplication.java @@ -0,0 +1,18 @@ +package ru.clearing.lim.exporter; + +import org.slf4j.LoggerFactory; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; + +@SpringBootApplication +public class LimExportApplication { + public static void main(String[] args) { + try { + SpringApplicationBuilder builder = new SpringApplicationBuilder(LimExportApplication.class); + builder.run(args); + } catch (Throwable e) { + LoggerFactory.getLogger(LimExportApplication.class).error("DBF-Loader start failed: {} -> {}", e.getClass().getSimpleName(), e.getMessage()); + System.exit(-1); + } + } +} diff --git a/clearing-parent/lim-exporter/src/main/java/ru/clearing/lim/exporter/config/settings/ExportLimServiceSettings.java b/clearing-parent/lim-exporter/src/main/java/ru/clearing/lim/exporter/config/settings/ExportLimServiceSettings.java new file mode 100644 index 000000000..ff437e161 --- /dev/null +++ b/clearing-parent/lim-exporter/src/main/java/ru/clearing/lim/exporter/config/settings/ExportLimServiceSettings.java @@ -0,0 +1,50 @@ +package ru.clearing.lim.exporter.config.settings; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; +import ru.spcex.clearing.platform.messaging.config.element.KafkaConsumerSettings; +import ru.spcex.clearing.platform.messaging.config.element.KafkaProducerSettings; +import ru.spcex.platform.imdg.iml.hazelcast.config.HazelcastClientParams; + +@Component +@PropertySource("file:${spring.config.location}/application.properties") +@ConfigurationProperties("export-dbf-service") +public class ExportLimServiceSettings { + private HazelcastClientParams hazelcast; + private KafkaConsumerSettings kafkaConsumer; + private KafkaProducerSettings kafkaProducer; + private Store store; + + public HazelcastClientParams getHazelcast() { + return hazelcast; + } + + public void setHazelcast(HazelcastClientParams hazelcast) { + this.hazelcast = hazelcast; + } + + public KafkaConsumerSettings getKafkaConsumer() { + return kafkaConsumer; + } + + public void setKafkaConsumer(KafkaConsumerSettings kafkaConsumer) { + this.kafkaConsumer = kafkaConsumer; + } + + public Store getStore() { + return store; + } + + public void setStore(Store store) { + this.store = store; + } + + public KafkaProducerSettings getKafkaProducer() { + return kafkaProducer; + } + + public void setKafkaProducer(KafkaProducerSettings kafkaProducer) { + this.kafkaProducer = kafkaProducer; + } +} diff --git a/clearing-parent/lim-exporter/src/main/java/ru/clearing/lim/exporter/config/settings/Store.java b/clearing-parent/lim-exporter/src/main/java/ru/clearing/lim/exporter/config/settings/Store.java new file mode 100644 index 000000000..4adebe4d9 --- /dev/null +++ b/clearing-parent/lim-exporter/src/main/java/ru/clearing/lim/exporter/config/settings/Store.java @@ -0,0 +1,14 @@ +package ru.clearing.lim.exporter.config.settings; + +public class Store { + + private String outDir; + + public String getOutDir() { + return outDir; + } + + public void setOutDir(String outDir) { + this.outDir = outDir; + } +} diff --git a/clearing-parent/lim-exporter/src/main/resources/application.properties b/clearing-parent/lim-exporter/src/main/resources/application.properties new file mode 100644 index 000000000..471634fbb --- /dev/null +++ b/clearing-parent/lim-exporter/src/main/resources/application.properties @@ -0,0 +1,18 @@ +spring.main.web-application-type=none + +export-lim-service.hazelcast.cluster-members=10.200.200.181:5701 +export-lim-service.hazelcast.login=dev +export-lim-service.hazelcast.password=dev-pass + +export-lim-service.common.encoding=cp866 +export-lim-service.common.threads-count=10 + +export-lim-service.store.out-dir=d:\\trash\\clearing\\exporter\\out\\ + +export-lim-service.kafka-consumer.bootstrap-servers=localhost:9092 +export-lim-service.kafka-consumer.group-id=dev-group-balance-service +export-lim-service.kafka-consumer.enable-auto-commit=false +export-lim-service.kafka-consumer.session-timeout-ms=30000 +export-lim-service.kafka-consumer.auto-offset-reset=latest +export-lim-service.kafka-consumer.linger-ms=1 +export-lim-service.kafka-consumer.buffer-memory=33554432 diff --git a/clearing-parent/lim-exporter/src/main/resources/logback.xml b/clearing-parent/lim-exporter/src/main/resources/logback.xml new file mode 100644 index 000000000..d1a27ddbf --- /dev/null +++ b/clearing-parent/lim-exporter/src/main/resources/logback.xml @@ -0,0 +1,37 @@ + + + + + UTF-8 + %date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + ./logs/lim-exporter.log + + UTF-8 + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + ../logs/lim-exporter.%i.log + + 1 + 10 + + + 500MB + + + + + + + + + + + + + \ No newline at end of file diff --git a/clearing-parent/pom.xml b/clearing-parent/pom.xml index 9ff3b6aab..245ed2fa0 100644 --- a/clearing-parent/pom.xml +++ b/clearing-parent/pom.xml @@ -36,6 +36,7 @@ registry-service test-clearing cleaning-builders + lim-exporter