2.1.6 • Published 1 month ago

exframe-etl-queue v2.1.6

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
1 month ago

ETL Queue

Initialization

  const { EtlQueue, EtlSteps } = require('exframe-etl-queue');
  const { db } = require('./lib/db');

  const queue = new EtlQueue(logger, EtlSteps.Transform, db);

Enqueue

The enqueuing of an etl message will only need to occur during the extraction process. Messages will automatically advance to the next ETL step queue when it is acknowledged after processing.

  const {fullDocument, updateDescription, _id: resumeToken, operationType, clusterTime, ns: { coll: collection }} = result;
  await queue.enqueue(context, collection, fullDocument.quoteNumber, resumeToken, {
        operationType,
        operationTimestamp: clusterTime,
        fullDocument,
        updateDescription
      });

Listen

The listen method accepts a callback to preform work on the message. The messsage should be update with any new data for the downstream processes. The message will automatically be acknowledged and move to the next process status. If an error occurs the message will automatically be placed in an error state and further processing will not occur.

  await queue.listen(context, async (context, message) => {
      const { documentType, documentId, date, sourceOperation: { operationType }} = message;
      message.targets = [
        { target: nanoid()}
      ];
    })
2.1.6

1 month ago

2.1.5

4 months ago

2.1.4

6 months ago

2.1.2

8 months ago

2.1.1

8 months ago

2.1.3

7 months ago

2.1.0

9 months ago

2.0.15

9 months ago

2.0.14

9 months ago

2.0.13

10 months ago

2.0.11

11 months ago

2.0.12

10 months ago

2.0.10

11 months ago

2.0.9

11 months ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.8

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

1.1.3

2 years ago

1.1.2

2 years ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.1.1

2 years ago

1.0.2

2 years ago

1.1.0

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago