npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kafka-penguin

v0.3.8

Published

An easy-to-use, light weight KafkaJS library for message re-processing strategies.

Downloads

11

Readme

Home

license issues last commitActions Status npm version​‌

About

Kafka-Penguin is an easy-to-use, lightweight KafkaJS plugin for message re-processing. It provides developers with three strategies for setting up message re-processing: FailFast, Ignore, and Dead Letter Queue.‌

The package allows developers to build event-driven applications with dedicated "fail strategies" modeled after best practices in the field. This in turn allows developers to effectively address bugs in development and deploy more fault-tolerant systems in production.‌

This package is meant to work in conjunction with with KafkaJS. For more information on KafkaJS, check out Getting Started with KafkaJS.‌

Getting Started

Install Kafka-Penguin as an npm module and save it to your package.json file as a dependency:

npm install kafka-penguin

Once installed it can now be referenced by simply calling require('kafka-penguin');

Example

All Kafka-Penguin needs is a KafkaJS client to run. Start by passing the client for your preferred strategy and Kafka-Penguin will create bespoke consumers, producers, and admins with built-in functionality to execute the chosen strategy. On the surface, you implement your application exactly as you would with KafkaJS.

/* eslint-disable no-console */
import { FailFast } from 'kafka-penguin';

const exampleClient = require('./clientConfig.ts');

// Set up the preferred strategy with a configured KafkaJS client
const exampleStrategy = new FailFast(2, exampleClient);

// Initialize a producer or consumer from the instance of the strategy
const producer = exampleStrategy.producer();

const message = {
  topic: 'wrong-topic',
  messages: [
    {
      key: 'hello',
      value: 'world',
    },
  ],
};

// Connect, Subscribe, Send, or Run virtually the same as with KafkaJS
producer.connect()
  .then(() => console.log('Connected!'))
  // The chosen strategy executes under the hood, like in this send method
  .then(() => producer.send(message))
  .catch((e: any) => console.log('error: ', e.message));

Strategies

Dive in deeper to any of the strategies for set up, execution, and implementation.

FailFast ​‌

Ignore​‌

Dead Letter Queue​‌

Contributors

Ausar English @ausarenglish​‌

Kushal Talele @ktrane1​‌

Timeo Williams @timeowilliams​‌

Ziyad El Baz @zelbaz946​‌

License

This product is licensed under the MIT License - see the LICENSE.md file for details.‌

This is an open source product. We are not affiliated nor endorsed by either the Apache Software Foundation or KafkaJS.‌

This product is accelerated by OS Labs.