Socket
Socket
Sign inDemoInstall

kafkajs-dlq

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kafkajs-dlq

KafkaJS plugin to quarantine messages on processing failure


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

KafkaJS Dead Letter Queue

KafkaJS plugin to handle message processing failures by forwarding problematic messages to a dead-letter queue.

Dead Letter Queues are message queues that can be produced to when a message on another queue cannot be processed successfully. Dead-letter queues are useful for debugging your application or messaging system because they let you isolate problematic messages to determine why their processing doesn't succeed.

WIP: This project is not ready for use as of yet

Usage

const { Kafka } = require('kafkajs')
const Dlq = require('kafkajs-dlq')

const kafka = new Kafka({ ... })
const consumer = kafka.consumer({ ... })
const producer = kafka.producer()

const topic = 'example-topic'

const { eachMessage } = Dlq.consumer({
  topics: {
    [topic]: 'example-dead-letter-queue'
  },
  producer,
  eachMessage: async ({ topic, partition, message }) => {
    // If eachMessage rejects, the message will be
    // produced on the dead-letter queue
    throw new Error('Failed to process message')
  }
})

const run = async () => {
  await consumer.connect()
  await consumer.subscribe({ topic })
  await consumer.run({ eachMessage })
}

run()

FAQs

Package last updated on 29 Jul 2018

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