Socket
Book a DemoInstallSign in
Socket

@arabesque/listener-kafka

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arabesque/listener-kafka

Kafka listener for Arabesque

0.3.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Kafka listener for Arabesque

NPM version Coverage Status

Prerequisites

  • KafkaJS version 1.15.0 and up

Getting started

Kafka listener for Arabesque consists of a type and a factory that returns an Arabesque Listener.

Configuration

import type {ConsumerConfig, KafkaConfig} from "kafkajs";

declare type Configuration = {
    client: KafkaConfig;
    consumer: ConsumerConfig;
};

The configuration supported by the listener factory:

  • client: The configuration passed to the KafkaJS client - please refer to KafkaJS documentation for details
  • consumer: The configuration passed to the KafkaJS consumer - please refer to KafkaJS documentation for details

createListener

declare const createListener: <Message>(configuration: Configuration) => Listener<Channel, Message>;

The factory that creates a Kafka listener. The returned listener is guaranteed to disconnect the consumer when the application is stopped.

Usage

import {createApplication} from "@arabesque/core";
import {createListener} from "@arabesque/listener-kafka";

const listener = createListener({
  client: {
    brokers: [
      'broker:29092'
    ]
  },
  consumer: {
    groupId: 'foo',
  }
});
const application = createApplication(listener);

application.listen('bar');

Contributing

  • Fork this repository
  • Code
  • Implement tests using tape
  • Issue a merge request keeping in mind that all pull requests must reference an issue in the issue queue

Keywords

arabesque

FAQs

Package last updated on 14 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.