example

command
v0.0.0-...-5fa6b44 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

README

Blocking Postgres Example

This directory contains an example of the blocking postgres input.

This is an enhanced version of the postgres input sample input which comes as part of Dapper Orchestrator.

The key difference being that the sample input is not cluster aware; if the orchestrator it's installed on is run over many replicas then you'll have as many inputs to process as you have clusters.

This example contains the pipeline

graph LR;
    db[Sales Database]
    in0[Postgres Input]
    proc0[Webhook Process: Call Notification Endpoint]
    end0[www.example.com]

    db-->in0
    in0-->proc0
    proc0-->end0

Where the webhook processor comes from github.com/dapper-data/dapper-orchestrator-contrib/webhooks, and is used purely for demonstration.

See that package's documentation for configuration.

Usage

This example uses the dead standard go toolchain:

$ go build
$ ./example

The default postgres DSN is: postgres://postgres:postgres@localhost:5432/tests?sslmode=disable but this may be configured with the environment variable:

$ export DATABASE_DSN='postgres://analytics-user@salesdb.internal:5432/sales'
$ ./example

(Tools such as https://webhook.site can be used, for instance, to see the returned payload)

To trigger the input, and thus the process, connect to your database and insert something to a table.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL