Skip to content

Commit

Permalink
feat(): Add support for MCL Timeseries (#120)
Browse files Browse the repository at this point in the history
Co-authored-by: John Joyce <[email protected]>
  • Loading branch information
jjoyce0510 and John Joyce authored Jul 1, 2024
1 parent 54a568b commit a4ca012
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
ENTITY_CHANGE_EVENT_NAME = "entityChangeEvent"
DEFAULT_TOPIC_ROUTES = {
"mcl": "MetadataChangeLog_Versioned_v1",
"mcl_timeseries": "MetadataChangeLog_Timeseries_v1",
"pe": "PlatformEvent_v1",
}

Expand Down Expand Up @@ -188,6 +189,13 @@ def events(self) -> Iterable[EventEnvelope]:
else:
if "mcl" in topic_routes and msg.topic() == topic_routes["mcl"]:
yield from self.handle_mcl(msg)
if (
"mcl_timeseries" in topic_routes
and msg.topic() == topic_routes["mcl_timeseries"]
):
yield from self.handle_mcl(
msg
) # Handle timeseries in the same way as usual MCL.
elif "pe" in topic_routes and msg.topic() == topic_routes["pe"]:
yield from self.handle_pe(msg)

Expand Down
4 changes: 3 additions & 1 deletion docs/sources/kafka-event-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ source:
# Topic Routing - which topics to read from.
topic_routes:
mcl: ${METADATA_CHANGE_LOG_VERSIONED_TOPIC_NAME:-MetadataChangeLog_Versioned_v1} # Topic name for MetadataChangeLogEvent_v1 events.
mcl_timeseries: ${METADATA_CHANGE_LOG_TIMESERIES_TOPIC_NAME:-MetadataChangeLog_Timeseries_v1} # Topic name for MetadataChangeLogEvent_v1 timeseries events.
pe: ${PLATFORM_EVENT_TOPIC_NAME:-PlatformEvent_v1} # Topic name for PlatformEvent_v1 events.
action:
# action configs
Expand All @@ -75,7 +76,8 @@ action:
| `connection.bootstrap` || N/A | The Kafka bootstrap URI, e.g. `localhost:9092`. |
| `connection.schema_registry_url` || N/A | The URL for the Kafka schema registry, e.g. `http://localhost:8081` |
| `connection.consumer_config` || {} | A set of key-value pairs that represents arbitrary Kafka Consumer configs |
| `topic_routes.mcl` || `MetadataChangeLogEvent_v1` | The name of the topic containing MetadataChangeLog events |
| `topic_routes.mcl` || `MetadataChangeLog_Versioned_v1` | The name of the topic containing versionined MetadataChangeLog events |
| `topic_routes.mcl_timeseries` || `MetadataChangeLog_Timeseries_v1` | The name of the topic containing timeseries MetadataChangeLog events |
| `topic_routes.pe` || `PlatformEvent_v1` | The name of the topic containing PlatformEvent events |
</details>

Expand Down

0 comments on commit a4ca012

Please sign in to comment.