Commit 4430309b authored by Matthias's avatar Matthias
Browse files

update dependencies, usage of latest service-utilities

parent 25fc9772
Pipeline #24783 failed with stages
in 1 minute and 13 seconds
......@@ -27,6 +27,7 @@ import javax.xml.parsers.DocumentBuilderFactory
import org.apache.logging.log4j.LogManager
import org.apache.poi.ss.usermodel.WorkbookFactory
import org.xml.sax.SAXException
import ch.memobase.reporting.Report
class FileValidation {
private val log = LogManager.getLogger("TextFileValidationService")
......
......@@ -23,6 +23,7 @@ import org.apache.kafka.clients.producer.KafkaProducer
import org.apache.kafka.clients.producer.ProducerRecord
import org.apache.kafka.common.header.Header
import org.apache.kafka.common.header.internals.RecordHeader
import ch.memobase.reporting.Report
class Producer(
props: Properties,
......
......@@ -28,10 +28,13 @@ import ch.memobase.sftp.SftpClient
import ch.memobase.reporting.Report
import ch.memobase.reporting.ReportStatus
class Service(fileName: String = "app.yml") {
private val log: Logger = LogManager.getLogger("TextFileValidationService")
companion object {
const val step = "text-file-validation"
}
val settings =
SettingsLoader(
listOf(
......@@ -76,7 +79,8 @@ class Service(fileName: String = "app.yml") {
val report = Report(
"$recordSetId#$sessionId",
status = ReportStatus.fatal,
message = "SFTP Exception: ${ex.localizedMessage}"
message = "SFTP Exception: ${ex.localizedMessage}",
step = Service.step
)
producer.sendReport(report)
exitProcess(1)
......@@ -102,7 +106,8 @@ class Service(fileName: String = "app.yml") {
val report = Report(
file.name,
status = ReportStatus.fatal,
message = "SFTP Exception: ${ex.localizedMessage}."
message = "SFTP Exception: ${ex.localizedMessage}.",
step = Service.step
)
producer.sendMessage(file.name, Message(Formats.error, "SFTP Error"))
producer.sendReport(report)
......@@ -117,7 +122,8 @@ class Service(fileName: String = "app.yml") {
Report(
"$recordSetId#$sessionId",
status = ReportStatus.fatal,
message = "SFTP Exception: ${ex.localizedMessage}."
message = "SFTP Exception: ${ex.localizedMessage}.",
step = Service.step
)
)
exitProcess(1)
......@@ -128,7 +134,8 @@ class Service(fileName: String = "app.yml") {
Report(
"$recordSetId#$sessionId",
status = ReportStatus.fatal,
message = "Unknown Exception: ${ex.localizedMessage}."
message = "Unknown Exception: ${ex.localizedMessage}.",
step = Service.step
)
)
exitProcess(1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment