1.0.1 • Published 9 months ago

terafoundation_kafka_connector v1.0.1

Weekly downloads
13
License
MIT
Repository
github
Last release
9 months ago

Kafka Connector

Terafoundation connector for Kafka producer and consumer clients.

To install from the root of your terafoundation based service.

npm install terafoundation_kafka_connector

Configuration:

The terafoundation level configuration is as follows:

FieldTypeDefaultDescription
brokersArray"localhost:9092"List of seed brokers for the kafka environment
security_protocol"plaintext", "ssl""plaintext"Protocol used to communicate with brokers
ssl_ca_locationString-File or directory path to CA certificate(s) for verifying the broker's key
ssl_certificate_locationString-Path to client's public key (PEM) used for authentication
ssl_crl_locationString-Path to CRL for verifying broker's certificate validity
ssl_key_locationString-Path to client's private key (PEM) used for authentication
ssl_key_passwordString-Private key passphrase

When using this connector in code, this connector exposes two different client implementations. One for producers type: producer and one for consumers type: consumer.

NameDescriptionDefaultRequired
optionsConsumer or Producer specific optionssee belowY
topic_optionslibrdkafka defined settings that apply per topic.{}N
rdkafka_optionslibrdkafka defined settings that are not subscription specific.{}N

The options object enables setting a few properties

NameDescriptionDefaultRequired
typeWhat type of connector is required. "consumer" or "producer".consumerN
groupFor type 'consumer', what consumer group to useN/AN
poll_intervalFor type 'producer', how often (in milliseconds) the producer connection is polled to keep it alive.100N

Consumer connector configuration example:

{
    options: {
        type: 'consumer',
        group: 'example-group'
    },
    topic_options: {
        'enable.auto.commit': false
    },
    rdkafka_options: {
        'fetch.min.bytes': 100000
    }
}

Producer connector configuration example:

{
    options: {
        type: 'producer',
        poll_interval: 1000,
    },
    topic_options: {},
    rdkafka_options: {
        'compression.codec': 'gzip',
        'topic.metadata.refresh.interval.ms': -1,
        'log.connection.close': false,
    }
}

Terafoundation configuration example:

terafoundation:
    connectors:
        kafka:
            default:
                brokers: "localhost:9092"
1.0.1

9 months ago

1.0.0

1 year ago

0.13.0

1 year ago

0.14.0

1 year ago

0.12.0

1 year ago

0.11.2

1 year ago

0.11.1

2 years ago

0.9.3

2 years ago

0.10.0

2 years ago

0.11.0

2 years ago

0.9.0

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.8.0

4 years ago

0.7.0

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.0

7 years ago