Git Product home page Git Product logo

emqx_plugin_kafka's Introduction

emqx-plugin-kafka

This is a kafka plugin for EMQX >= 5.0.

代码说明

Release

A EMQX plugin release is a zip package including

  1. A JSON format metadata file
  2. A tar file with plugin's apps packed

Execute make rel to have the package created like:

_build/default/emqx_plugrel/emqx_plugin_kafka-<vsn>.tar.gz

See EMQX documents for details on how to deploy the plugin.

Plugin read config from /opt/emqx/etc/emqx_plugin_kafka.conf, exmple:

kafka {
    ## required
    client  {
        ## required
        client_id = "emqx_kafka"
        ## required
        servers = [ "localhost:9092" ]
        ## allow: per_partition | per_broker
        ## default: per_partition
        connection_strategy = per_partition
        ## unit: ms
        ## default: 5000
        min_metadata_refresh_interval = 5000
        ## allow: boolean
        ## default: true
        query_api_versions = true
        ## unit: ms
        ## default: 240000
        request_timeout = 240000
        ## optional
        ## sasl  { 
        ##     ## allow: plain | scram_sha_256 | scram_sha_512
        ##     mechanism = plain
        ##     username = "username"
        ##     password = "password"
        ##  }
        ## optional
        ##  ssl {
        ##     ## allow: verify_none | verify_none
        ##     verify = verify_none
        ##     ca_cert_file = "/etc/ssl/cert.pem"
        ##     depth = 3
        ##     ##  enable support for common wildcard certificates
        ##     customize_hostname_check = true
        ##  }
    }
    ## required
    ## global kafka producer config
    producer {
        ## allow: sync | async
        ## default: sync
        produce = sync
        ## unit: ms
        ## default: 3000
        produce_sync_timeout = 3000
        ## mqtt payload encode for kafak
        ## allow: plain | base64
        ## default: plain
        encode_payload_type = plain
        ## Base directory for replayq to store messages on disk
        ## default: undefined
        replayq_dir = undefined
        ## allow: no_compression | snappy | gzip
        ## default: no_compression
        compression = no_compression
        ## allow: random | roundrobin
        partitioner = random
    }
    ## required
    ## emqx hook config
    hook = [
        {
        ## hook point 
        hook = "message.publish"
        ## emqx topic pattern
        filter = "test/#"
        ## kafka topic
        topic = "test"
        ## kafka key pattern
        key = "${topic}"
        ## kafka value pattern
        value = "{ \"topic\" : \"${topic}\", \"payload\" : \"${payload}\", \"ts\" : \"${ts}\" }"
        ## optional
        ## kafka producer config
        ## producer {
        ##    produce = sync
        ##    produce_sync_timeout = 3000
        ##    encode_payload_type = plain
        ##    replayq_dir = undefined
        ##    compression = no_compression
        ##    partitioner = random
        ## }
        }
    ] 
}

emqx_plugin_kafka's People

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.