Skip to content

Instantly share code, notes, and snippets.

import { Kafka, Producer, Partitioners } from 'kafkajs';
export class KafkaProducer{
private kafka: Kafka;
private producer: Producer;
private brokers: string[];
private crashes: number;
private maxCrashes: number;
import {KafkaConsumer} from "./kafkaConsumer";
import jwt from 'jsonwebtoken';
export class ServiceConsumer{
private kafkaConsumer: KafkaConsumer;
constructor(){
//Create the Kafka consumer instance and subscribe to the topics
@fs-doc
fs-doc / kafkaConsumer.ts
Last active April 12, 2024 10:50
Basic Kafka Consumer using KafkaJS
import {
Kafka,
Consumer,
MessageSetEntry,
RecordBatchEntry,
ConsumerSubscribeTopics,
ITopicConfig
} from 'kafkajs';
import { v4 as uuidv4 } from 'uuid';
@fs-doc
fs-doc / commitPad.js
Created September 12, 2023 12:02
Simple Commit NotePad
/*
* Basic Commit Notepad
*/
// $ node committer.js [branch]
const { exec } = require("child_process");
const branch = process.argv[2] ? process.argv[2] : 'master'; //Master by default
const now = new Date();
const date = `${now.getDate()}.${now.getMonth() + 1}.${now.getFullYear()}`;
@fs-doc
fs-doc / external-secrets-operator.sh
Created December 1, 2022 19:38
Install external secrets operator via helm
helm repo add external-secrets https://charts.external-secrets.io