Skip to content

Passthrough

Unstable API 0.7.0 @project-lakechain/passthrough TypeScript

The Passthrough middleware acts, as its name implies, as a passthrough for document events. Its main purpose is to log document events and their associated metadata.


➡️ Logging Events

To use this middleware, you import it in your CDK stack and instantiate it as part of a pipeline.

import { Passthrough } from '@project-lakechain/passthrough';
import { CacheStorage } from '@project-lakechain/core';
class Stack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string) {
// The cache storage.
const cache = new CacheStorage(this, 'Cache');
// The passthrough middleware.
const passthrough = new Passthrough.Builder()
.withScope(this)
.withIdentifier('Passthrough')
.withCacheStorage(cache)
.withSource(source) // 👈 Specify a data source
.build();
}
}


Resolving Metadata

As seen in the Events section, metadata associated with a document event can contain Pointers to other documents. You can configure the Passthrough middleware to resolve those pointers and log their value in CloudWatch logs for debugging purposes.

const passthrough = new Passthrough.Builder()
.withScope(this)
.withIdentifier('Passthrough')
.withCacheStorage(cache)
.withSource(source)
.withResolveMetadata(true)
.build();


🏗️ Architecture

The Passthrough middleware executes within a Lambda compute, consumes input events, logs their information to AWS CloudWatch Logs and passes through the events to the next middlewares in the pipeline.

Passthrough Architecture



🏷️ Properties


Supported Inputs
Mime TypeDescription
*/*The passthrough middleware can consume any type of document.
Supported Outputs
Mime TypeDescription
*/*The passthrough middleware can produce any type of document.
Supported Compute Types
TypeDescription
CPUThis middleware is based on a Lambda architecture.

📖 Examples

  • Delay Pipeline - An example showcasing how to delay a pipeline execution.