Commit bd52e763 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Ignore messages which contain the word ERROR.

parent e7b71c03
Pipeline #11862 passed with stages
in 5 minutes and 8 seconds
......@@ -99,6 +99,14 @@ class Ingester(private val producer: Producer, private val sftpClient: SftpClien
}
private fun processRecord(record: ConsumerRecord<String, String>): Report {
if (record.value().contains("ERROR")) {
return Report(
id = record.key(),
status = ReportStatus.failure,
message = ReportMessages.ingestFailed(record.key())
)
}
return try {
ingest(record.key(), record.value())
Report(
......
......@@ -18,16 +18,14 @@
package org.memobase
import java.util.Properties
import org.apache.kafka.clients.consumer.ConsumerRecord
// import org.bouncycastle.cms.RecipientId.password
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
import org.fcrepo.client.FcrepoOperationFailedException
import org.memobase.fedora.FedoraClient
import org.memobase.fedora.FedoraClientImpl
// import org.bouncycastle.cms.RecipientId.password
import org.memobase.settings.SettingsLoader
import org.memobase.sftp.SftpClient
import java.util.Properties
class Service(fileName: String = "app.yml") {
......
Supports Markdown
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