GithubHelp home page GithubHelp logo

flink-http-connector's Introduction

flink-http-connector

This is a flink connector for http/https, can running with java 1.8 and flink 1.12.0.

Use HttpURLConnection/HttpsURLConnection to connect to the web server, Note: ignore ssl verification when using HttpsURLConnection.

If you use java 11 and flink 1.15+, check out getindata/flink-http-connector.

Now only supports sink!

Prerequisites

  • Java 8
  • Maven 3
  • Flink 1.12+
  • java.net.HttpURLConnection

Sample

        tableEnv.executeSql(
        "CREATE TABLE Orders (id STRING, id2 STRING, proc_time AS PROCTIME())"
        + " WITH ("
        + "'connector' = 'datagen', 'rows-per-second' = '1', 'fields.id.kind' = 'sequence',"
        + " 'fields.id.start' = '1', 'fields.id.end' = '120',"
        + " 'fields.id2.kind' = 'sequence', 'fields.id2.start' = '2',"
        + " 'fields.id2.end' = '120')"
        );

        tableEnv.executeSql(
        "create table sinktable (id STRING, id2 STRING)"
        + " WITH ("
        + "'connector' = 'http-sink',"
        + "'format' = 'json',"
        + "'method' = 'POST',"
        + "'http.log.success' = 'true',"
        + "'http.log.fail' = 'true',"
        + "'http.header.Content-Type' = 'application/json',"
        + " 'url' = 'http://127.0.0.1:8000/post' "
        + ")"
        );

Connector Options

HTTP Sink

Option Required Description/Value
connector required Specify what connector to use. Can only be 'http-sink'.
url required The base URL that should be use for HTTP requests. For example http(s)://localhost:8080/client.
format required Can only be 'json'.
method required Specify which HTTP method to use in the request. The value should be set either to GET,DELETE, POST or PUT.
use-https optional true or false, When true, will use https protocol. default false .
http.log.fail optional true or false, default be true, When response status != 200, log error msg.
http.log.success optional true or false, default be true, When response status == 200, log response body.

flink-http-connector's People

Contributors

coodajingang avatar

Watchers

 avatar  avatar  avatar

Forkers

wcq773187075

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.