Skip to content

Hydro Event Hub

Mikkel Stensgaard edited this page Feb 28, 2024 · 3 revisions

Overview

Measurements are provided through an API and as a change feed through an Event Hub.

This page describes the Event Hub.

An event hub allows the caller to listen to additions, deletions and changes of measurements as a stream of events.

Endpoint, Authentication & Authorization

To get access to the event hub the following is needed

  • Endpoint URL of the event hub
  • An access key. Contact DMP Support for further details.

Retention

Retention time is currently 5 days, which means that data is kept on the event hub for 5 days after being published. This does not depend on the measurement date, but the creation date.

Reading from the event hub

Microsoft has excelent documentation on reading from an event hub in many languages such as .NET, Python, Javascript and others. See Quickstart: Send events to and receive events from Azure Event Hubs for more information.

Events

All events are published on a single eventhub called 'measurements' . 3 types of events exists

  • Measurement Added
  • Measurement Updated
  • Measurement Deleted

The events can be distuignished by the "EventType" property and consists of a subset of the following properties

Property Type Measurement Added Measurement Updated Measurement Deleted
EventType string "MeasurementAdded" "MeasurementUpdated" "MeasurementDeleted"
stationId string    x x x
operatorStationId string   x x x
measurementPointNumber   bigint   x x x
examinationTypeSc bigint x x x
measurementDateTime datetime x x x
loggerId string  x  
parameterSc bigint   x
unitSc bigint   x
formulaId string x
result float x x
reasonCodeSc bigint x x

The meaning of the individual properties can be found on the API page.

Filtered data

To avoid excessive amounts of date during datea migration, the following rules apply

  • New measurements are published to the event hub if the measurement date is less than 180 days ago. This is around 6 months.
  • All deletes of measurements are published to the event hub - independent of the measurement date.
  • All updates of measurements are published to the event hub - independent of the measurement date.