Guides
...
Usage Metering
Backfill Meters and Customers

Java sample to backfill meters from MongoDB

2min

Java sample to backfill meters from historical data stored in MongoDB into Amberflo.

The sample will perform the following tasks:

  1. Read entries from MongoDB collection. In this sample, events are ingested as meters into Amberflo.
  2. For each entry, ingest an event meter into Amberflo. Ensure the create time is used as ingested event time in UTC. Use the entry id as uniqueId of the ingested meter to prevent duplicated ingested records if the code were to run multiple times.

Maven dependencies (check for latest versions):

XML

Java