Skip to content

Passthrough

Unstable API 0.10.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.


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();
}
}


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();


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




Mime Type Description
*/* The passthrough middleware can consume any type of document.
Mime Type Description
*/* The passthrough middleware can produce any type of document.
Type Description
CPU This middleware is based on a Lambda architecture.
  • Delay Pipeline - An example showcasing how to delay a pipeline execution.