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

Add reporting step value

parent 35d0b44a
Pipeline #31572 passed with stages
in 5 minutes and 21 seconds
......@@ -8,3 +8,4 @@ data:
TOPIC_IN: "{{ .Values.inputTopicName }}"
TOPIC_OUT: "{{ .Values.outputTopicName }}"
TOPIC_PROCESS: "{{ .Values.reportingTopicName }}"
REPORTING_STEP_NAME: "{{ .Values.reportingStepName }}"
......@@ -18,4 +18,6 @@ inputTopicName: placeholder
outputTopicName: placeholder
reportingTopicName: placeholder
applicationId: placeholder
groupId: placeholder
\ No newline at end of file
groupId: placeholder
reportingStepName: 09.02-iiif-manifest-creator
\ No newline at end of file
app:
reportingStepName: ${REPORTING_STEP_NAME:?system}
kafka:
streams:
bootstrap.servers: ${KAFKA_BOOTSTRAP_SERVERS:?system}
......
......@@ -28,16 +28,17 @@ import scala.collection.JavaConverters._
import scala.util.{Failure, Success, Try}
object App extends scala.App with Logging {
val reportingStepNameProp = "reportingStepName"
val topology = new KafkaTopology
private val settings = new SettingsLoader(
List[String]().asJava,
List[String](reportingStepNameProp).asJava,
"app.yml",
false,
true,
false,
false
)
val topology = new KafkaTopology(settings.getAppSettings.getProperty(reportingStepNameProp))
val streams = new KafkaStreams(
topology.build(
......
......@@ -26,7 +26,7 @@ import org.apache.logging.log4j.scala.Logging
import scala.util.Try
class KafkaTopology extends Logging {
class KafkaTopology(private val step: String) extends Logging {
import KafkaTopologyUtils._
import Serdes._
......@@ -98,7 +98,8 @@ class KafkaTopology extends Logging {
ReportingObject(
k,
ProcessingWarning,
v.get.warnings.mkString("\n")
v.get.warnings.mkString("\n"),
step
).toString
)
)
......@@ -115,7 +116,8 @@ class KafkaTopology extends Logging {
ReportingObject(
k,
ProcessingSuccess,
"IIIF manifest successfully created"
"IIIF manifest successfully created",
step
).toString
)
)
......@@ -132,7 +134,8 @@ class KafkaTopology extends Logging {
ReportingObject(
k,
ProcessingFatal,
s"Error creating manifest: ${v.failed.get.getMessage}"
s"Error creating manifest: ${v.failed.get.getMessage}",
step
).toString
)
)
......@@ -150,7 +153,8 @@ class KafkaTopology extends Logging {
ReportingObject(
k,
ProcessingIgnore,
message
message,
step
).toString
)
)
......
......@@ -46,12 +46,13 @@ case object ProcessingFatal extends ProcessingStatus {
case class ReportingObject(
id: String,
status: ProcessingStatus,
message: String
message: String,
step: String
) {
override def toString: String =
ujson.write(
ujson.Obj(
("step", "iiif-manifest-creator"),
("step", step),
("timestamp", createTimestamp),
("id", id),
("status", status.value),
......
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