Skip to content

Commit

Permalink
remove uuid from event_id@48577, and added it to aer_02@48577 SD data (
Browse files Browse the repository at this point in the history
…#36)

* remove uuid from event_id@48577, and added it to aer_02@48577 structured data.

* move uuid back to event_id@48577, change "id_source" value to "aer_02"
  • Loading branch information
eemhu authored Nov 11, 2024
1 parent 3ca061c commit da31cd9
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/main/java/com/teragrep/aer_02/EventDataConsumer.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,11 @@ public Long getValue() {
}
});

String eventUuid = null; //TODO: Message id not available?

// FIXME proper handling of non-provided uuids
if (eventUuid == null) {
eventUuid = "aer_02=" + UUID.randomUUID();
}

SDElement sdId = new SDElement("event_id@48577")
.addSDParam("uuid", UUID.randomUUID().toString())
.addSDParam("hostname", realHostName)
.addSDParam("uuid", eventUuid)
.addSDParam("unixtime", Instant.now().toString())
.addSDParam("id_source", "source");
.addSDParam("id_source", "aer_02");

SDElement sdPartition = new SDElement("aer_02_partition@48577")
.addSDParam(
Expand All @@ -134,13 +127,10 @@ public Long getValue() {

String partitionKey = String.valueOf(systemProps.getOrDefault("PartitionKey", ""));

// TODO: Correlation id not available?
// String correlationId = props.get("correlationId").toString();
SDElement sdEvent = new SDElement("aer_02_event@48577")
.addSDParam("offset", offset == null ? "" : offset)
.addSDParam("enqueued_time", enqueuedTime == null ? "" : enqueuedTime.toString())
.addSDParam("partition_key", partitionKey == null ? "" : partitionKey);
//.addSDParam("correlation_id", correlationId == null ? "" : correlationId);
props.forEach((key, value) -> sdEvent.addSDParam("property_" + key, value.toString()));

SDElement sdComponentInfo = new SDElement("aer_02@48577")
Expand All @@ -156,7 +146,6 @@ public Long getValue() {
.withSDElement(sdPartition)
.withSDElement(sdEvent)
.withSDElement(sdComponentInfo)
//.withSDElement(sdCorId)
.withMsgId(String.valueOf(systemProps.getOrDefault("SequenceNumber", "0")))
.withMsg(eventData);

Expand Down

0 comments on commit da31cd9

Please sign in to comment.