New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kafka

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kafka

A node client for Kafka

  • 0.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
736
decreased by-29.64%
Maintainers
1
Weekly downloads
 
Created
Source

Main project repo moved

This project is most actively used and maintained by Taylor Gautier at Tagged.

Please see the Tagged node-kafka repo.

Kafka javascript API

Interact with Kafka, LinkedIn's disk based message queue using node.js

Get up and running

1 Install kafka

npm install kafka

2 Start zookeeper, kafka server, and a consumer (see http://sna-projects.com/kafka/quickstart.php)

3 Publish and consume some messages!

var kafka = require('kafka')

new kafka.Consumer().connect().subscribeTopic('test').on('message', function(topic, message) {
	console.log("Consumed message:", message)
})

var producer = new kafka.Producer().connect().on('connect', function() {
	producer.send("hey!")
	producer.close()
})

API

kafka.Consumer

var consumer = new kafka.Consumer({
	// these are the default values
	host:         'localhost',
	port:          9092,
	pollInterval:  2000,
	maxSize:       1048576 // 1MB
})
consumer.on('message', function(topic, message) { 
    console.log(message)
})
consumer.connect(function() {
    consumer.subscribeTopic({name: 'test', partition: 0})
})

kafka.Producer

var producer = new kafka.Producer({
	// these are also the default values
	host:         'localhost',
	port:         9092,
	topic:        'test',
	partition:    0
})
producer.connect(function() {
	producer.send('message bytes')
})

Authors

  • Marcus Westin (clover)
  • Taylor Gautier (tagged)

Contributors

  • Laurie Harper
  • @omnichuck
  • @philips

FAQs

Package last updated on 09 Dec 2012

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc