• Stars
    star
    3,599
  • Rank 11,787 (Top 0.3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 7 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A modern Apache Kafka client for node.js

npm version npm pre-release version Build Status Slack Channel

Logo

KafkaJS

A modern Apache Kafka® client for Node.js
Get Started »

Read the Docs · Report Bug · Request Feature

Table of Contents

About the Project

KafkaJS is a modern Apache Kafka client for Node.js. It is compatible with Kafka 0.10+ and offers native support for 0.11 features.

KAFKA is a registered trademark of The Apache Software Foundation and has been licensed for use by KafkaJS. KafkaJS has no affiliation with and is not endorsed by The Apache Software Foundation.

Sponsors ❤️

Upstash: Serverless Kafka

  • True Serverless Kafka with per-request-pricing
  • Managed Apache Kafka, works with all Kafka clients
  • Built-in REST API designed for serverless and edge functions
  • Start for free in 30 seconds!
Logo

Get help directly from a KafkaJS developer

  • Become a Github Sponsor to have a video call with a KafkaJS developer
  • Receive personalized support, validate ideas or accelerate your learning
  • Save time and get productive sooner, while supporting KafkaJS!
  • See support options!

To become a sponsor, reach out in our Slack community to get in touch with one of the maintainers. Also consider becoming a Github Sponsor by following any of the links under "Sponsor this project" in the sidebar.

Features

  • Producer
  • Consumer groups with pause, resume, and seek
  • Transactional support for producers and consumers
  • Message headers
  • GZIP compression
    • Snappy, LZ4 and ZSTD compression through pluggable codecs
  • Plain, SSL and SASL_SSL implementations
  • Support for SCRAM-SHA-256 and SCRAM-SHA-512
  • Support for AWS IAM authentication
  • Admin client

Getting Started

npm install kafkajs
# yarn add kafkajs

Usage

const { Kafka } = require('kafkajs')

const kafka = new Kafka({
  clientId: 'my-app',
  brokers: ['kafka1:9092', 'kafka2:9092']
})

const producer = kafka.producer()
const consumer = kafka.consumer({ groupId: 'test-group' })

const run = async () => {
  // Producing
  await producer.connect()
  await producer.send({
    topic: 'test-topic',
    messages: [
      { value: 'Hello KafkaJS user!' },
    ],
  })

  // Consuming
  await consumer.connect()
  await consumer.subscribe({ topic: 'test-topic', fromBeginning: true })

  await consumer.run({
    eachMessage: async ({ topic, partition, message }) => {
      console.log({
        partition,
        offset: message.offset,
        value: message.value.toString(),
      })
    },
  })
}

run().catch(console.error)

Learn more about using KafkaJS on the official site!

Read something on the website that didn't work with the latest stable version?
Check the pre-release versions - the website is updated on every merge to master.

Contributing

KafkaJS is an open-source project where development takes place in the open on GitHub. Although the project is maintained by a small group of dedicated volunteers, we are grateful to the community for bug fixes, feature development and other contributions.

See Developing KafkaJS for information on how to run and develop KafkaJS.

Help wanted 🤝

We welcome contributions to KafkaJS, but we also want to see a thriving third-party ecosystem. If you would like to create an open-source project that builds on top of KafkaJS, please get in touch and we'd be happy to provide feedback and support.

Here are some projects that we would like to build, but haven't yet been able to prioritize:

Contact 💬

Join our Slack community

License

See LICENSE for more details.

Acknowledgements

Apache Kafka and Kafka are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries. KafkaJS has no affiliation with the Apache Software Foundation.

More Repositories

1

json-viewer

It is a Chrome extension for printing JSON and JSONP.
HTML
3,260
star
2

mappersmith

is a lightweight rest client for node.js and the browser
TypeScript
330
star
3

jquery.silver_track

A smart and very extensible jquery sliding carousel
JavaScript
76
star
4

burrow-stats

Dashboard for burrow kafka consumer lag checking
JavaScript
49
star
5

ember-webpack-example

TodoMVC app implemented using Ember + webpack
JavaScript
27
star
6

nightcrawler_swift

Like the X-Men nightcrawler this gem teleports your assets to a OpenStack Swift bucket/container
Ruby
22
star
7

placeholder_shimmer

Similar to facebook's placeholder animation
CSS
19
star
8

icosmith

Icon font generator server
Ruby
18
star
9

better_helpers

It is a better way to organize and maintain your Rails helpers
Ruby
17
star
10

jquery.chaos

A dynamic mess organizer plugin
JavaScript
13
star
11

ember-webpack-loaders

a set of webpack loaders to help with ember integration
JavaScript
13
star
12

react-memory-game

This is an exercise for a react workshop
JavaScript
10
star
13

mappersmith-cached-gateway

It is a gateway for Mappersmith that wraps a transport gateway with a cache store to achieve transparent cache functionalities
JavaScript
10
star
14

tiny-kafka

is a tiny implementation of Apache Kafka, targeting your test environments
JavaScript
9
star
15

liferay_models

ActiveRecord liferay models
Ruby
8
star
16

sexy_download

A Script that retrieves google chrome cookies and calls aria2c for multithreading download
Ruby
7
star
17

mappersmith-object

It aims to provide a light layer on top of your objects/responses to help with common annoyances which the javascript world provides daily
JavaScript
7
star
18

dojo-brasilia-sudoku

A sudoku in java.
Java
7
star
19

jquery.lazy_content

jquery plugin for lazy load of any content
HTML
6
star
20

dojo-brasilia-robosexploradores

Java
6
star
21

remotebattle

Jogo de batalha naval multiplayer
Java
6
star
22

css-color-highlight

Atom plugin to Highlight colors
CoffeeScript
6
star
23

kafkajs-snappy

Snappy codec for KafkaJS
JavaScript
5
star
24

omnichat

A good chat platform!!
CoffeeScript
4
star
25

battlefield3.dashboard

Battlefield 3 score dashboard
Ruby
4
star
26

projetofinal-roteiros

Montagem e avaliação de roteiros de viagens
Ruby
4
star
27

liferay_webservices

The missing wrapper for liferay webservices
Ruby
4
star
28

lembremeuscontatos

O projeto gerencia um conjunto de mensagens que devem ser enviadas a um grupo de contatos a cada tanto tempo
JavaScript
4
star
29

proxy_machine

A cool proxy implementation pattern in ruby
Ruby
4
star
30

stale_if_slow

Is a quality assurance tool for methods that access external services or have slow operations that could rely on stale cache in case of problem.
Ruby
4
star
31

money_mg

Gerenciador financeiro
Ruby
3
star
32

dmdspec

Behavior driven development in D
D
3
star
33

andmyaxe

And My Axe
Ruby
3
star
34

dojo-brasilia-placas

http://www.dcc.fc.up.pt/oni/problemas/2008/qualificacao/probA.html
Java
3
star
35

dojo-brasilia-numerotoliteral

Java
3
star
36

pivotal-cmd

Command line tool for pivotal
Ruby
3
star
37

mappersmith-redux-middleware

it is a middleware for mappersmith which dispatches your request lifecycle to a redux store
JavaScript
3
star
38

liferay_database_config_reader

Allow the rails portlet app to read and configure database with liferay portal-ext.properties
Ruby
3
star
39

datasync

Java
2
star
40

downloader

File downloader written in Go
Go
2
star
41

mappersmith-circuit-breaker

Circuit breaker implementation for Mappersmith, it protects your application from failures of it's service dependencies
JavaScript
2
star
42

icosmith-rails

Rails integration with an icosmith server
Ruby
2
star
43

miranda

A java web MVC framework made with regard to study
Java
2
star
44

webpack-css-inject-loader

Webpack loader to automatically import CSS/SCSS
JavaScript
2
star
45

component_swarm

Ruby
2
star
46

horas_trabalhadas

Projeto horasTrabalhadas em Rails
JavaScript
2
star
47

produtor_consumidor

resolução do problema produtor x consumidor em ruby
Ruby
1
star
48

problema2

Suponha que você precisa implementar um robo
1
star
49

mappersmith-playground

CSS
1
star
50

load_balancer

Load balancer written in Go
Go
1
star
51

webpack-study

Experiments with Webpack
JavaScript
1
star
52

dot-vim

vim configs
Shell
1
star
53

icosmith-rails-example

Example of icosmith-rails configured
Ruby
1
star
54

picheme_android

Cliente android para o piche.me, similar ao cliente para o google chrome
Java
1
star
55

sleeping_barber

Sleeping barber in Go
Go
1
star
56

dojoCounter

Java
1
star
57

dot-atom

Configurations and plugins of my atom editor
JavaScript
1
star
58

link_unprotect

Unprotects some dumb 'protected' links.
Ruby
1
star
59

virtual_date

To and from dates in a second
Ruby
1
star
60

dashwall

JavaScript
1
star
61

dojo-brasilia-espiral

Calculo de uma matriz em espiral usando * / - +
Java
1
star
62

component_swarm_test

Ruby
1
star
63

filosofos_glutoes

Problema clássico do Jantar dos filosofos em Ruby
Ruby
1
star
64

pong

Pong block destroyer game =]
Ruby
1
star
65

problema3

Crie um sistema web de TODO list. Os requisitos são por sua conta.
JavaScript
1
star
66

dojo-brasilia-piratas

http://groups.google.com.br/group/dojo-brasilia?hl=pt-BR
Java
1
star
67

problema1

Qual inteiro positivo abaixo de 1 milhão, produz a sequencia com mais items? dado n -> n/2 (se n é par) n -> 3n + 1 (se n é impar)
Ruby
1
star
68

rspec_runner

Adds suite of tests feature on RSpec (awesome if you have 1k+ tests)
Ruby
1
star