Git Product home page Git Product logo

backend-test's Introduction

godoc for benthosdev/benthos Coverage Build Status

ETL (extract, transform and load)

ETL Use Benthos to solve the ETL challenge


Source

label: "random_user"
http_client:
    url: "https://random-data-api.com/api/users/random_user"
    headers:
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0
        Accept: application/json
    tls:
        enabled: true
        skip_cert_verify: false
    rate_limit: random

Other build-in sources

Benthos rate limits plugin

random

The random rate limit is X every (Y1 - Y2)ms rate limit that can be shared across any number of components within the pipeline but does not support distributed rate limits across multiple running instances of Benthos.

# Config fields, showing default values
label: ""
random:
  count: 1
  min_interval: 250ms
  max_interval: 720ms

Fields

count

The maximum number of requests to allow for a given period of time.

Type: int Default: 1

min_interval

The minmum time window to limit requests by.

Type string Default: 250ms

max_interval

The maxmum time window to limit requests by.

Type string Default: 750ms


Transform

pipeline:
    threads: 4
    processors:
        - label: transform
          bloblang: |
              root = {}
              root.id = this.id
              root.first_name = this.first_name
              root.last_name = this.last_name
              root.date_of_birth = this.date_of_birth
              root.city = this.address.city
              root.street_name = this.address.street_name
              root.street_address = this.address.street_address
              root.zip_code = this.address.zip_code
              root.state = this.address.state
              root.country = this.address.country
              root.lat = this.address.coordinates.lat.number()
              root.lng = this.address.coordinates.lng.number()

Other build-in processors


Sink

output:
    label: postgres
    sql_raw:
        driver: postgres
        dsn: ${BENTHOS_DSN}
        query: >
            INSERT INTO random_user (id, first_name, last_name, date_of_birth, city, street_name, street_address, zip_code, state, country, lat, lng)
            VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
            ON CONFLICT(id) DO UPDATE SET
              first_name=$2, last_name=$3, date_of_birth=$4, city=$5, street_name=$6, street_address=$7, zip_code=$8, state=$9, country=$10, lat=$11, lng=$12;
        args_mapping: |
            root = [
              this.id,
              this.first_name,
              this.last_name,
              this.date_of_birth,
              this.city,
              this.street_name,
              this.street_address,
              this.zip_code,
              this.state,
              this.country,
              this.lat,
              this.lng
            ]
        batching:
            period: 1s

Other build-in sinks

Author

Steven Chong

backend-test's People

Contributors

actions-user avatar teamchong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.