Kafka Nodejs Example with Producers and Consumers

Let’s take a look at a Kafka Nodejs example with Producers and Consumers. We will be creating a kafka producer and consumer in Nodejs. If you haven’t already, check out my previous tutorial on how to setup Kafka in docker. I already created a topic called cat that I will be using. Kafka Producer We are going to use the npm module called kafka-node to interface with our kafka and zookeeper.

Setup Kafka Zookeeper in Docker

Setting up Apache Kafka and Zookeeper in docker is easy thanks to popular DockerFiles like wurstmeister/kafka-docker. Let’s go through a quick setup of Kafka and Zookeeper in docker on a single node system. Prerequisites Linux System Git Docker Docker-compose Kafka and Zookeeper Start by cloning the repo: git clone https://github.com/wurstmeister/kafka-docker Then change to the kafka-docker directory: cd kafka-docker Now let’s edit the docker-compose.yml file. Change the Kafka Advertised Hostname to localhost:

Flying a Drone With Javascript

Flying a drone with javascript probably sounds crazy and hard. Do I use a framework? Will the 10 GB of node_modules weigh it down? NOPE! It’s all pretty simple to do. The other day I came across a neat drone called the DJI Tello. It is a relatively inexpensive quadcopter that offers a simple SDK which can be accessed over WiFI. Using the NodeJS dgram library, I can send commands via UDP to the drone to perform actions such as takeoff, left 20, and land.

Success from Things You Don't Care About

I had just finished a YouTube that I spent a week working on; a couple of days working on the graphics, a day of voice recording, and a few more hours coming up with a nice thumbnail. I uploaded it, and eagerly awaited the YouTube algorithm to award my quality work with a burst of views and watch time. I sat and waited in anticipation. Hour one went by, nothing. Okay, maybe it’s just a little slow today.

Google's Monthly Keyword Search Volume Doesn't Matter

I spent the last month focusing a lot on seo (Search Engine optimization). One of the biggest mistakes that I made was using Google’s monthly keyword search volume as an indicator on whether a particular keyword has sufficient search volume to pursue. Google’s monthly keyword search volume is completely wrong. I found large discrepancies when comparing my actual data from Google analytics to what Google says the traffic should be.

Learning to Declutter and Clear Your Mind

I’m a mental hoarder. If you were to look inside my head, you would find all types of mental clutter. Boxes labeled “random shower thoughts”, trashcans full of personal bullshit, and a closet overflowing with reminders, ideas and useless information. This creates a negative impact on my ability to recall and recollect. I often find myself in this awkward situation where this was something I know I took a mental note of, but I just can’t remember what it was.

I Want to Do Everything so I Do Nothing

One of the most challenging areas of self discipline in life is time management. I often find myself in situations where I do not have enough time to complete all the things that I want to do. And it’s not because I am procrastinating; the second I get home from work I jump right into some new side project or video. The problem is that there are simply too many things that I want to do right now, and learning the personal discipline to say no to myself is challenging.

Scrape Google Search Using Puppeteer

For my side project, I needed to scrape Google search using a headless browser. I ended up using the Nodejs library called puppeteer. It’s a headless browser that uses chromium. Install puppeteer npm install puppeteer Scrape Google Search using Puppeteer First, let’s go to the google homepage, type something in, and click the search button. try { (async () => { const browser = await puppeteer.launch(); const page = await browser.

Complacency After College

Up until graduation day, everything made sense. I’ll go to class, get good grades, then land a decent paying job so that I can move out of my parents and “start my life”. Amazingly, all of that happened fresh out of college at 22 years old. Back then, a couple of my peers have told me, “Damn dude, you’re living the dream.” In reality, I felt like I was far from it.

Install Hyperledger Fabric on Kubernetes

I recently had the “amazing 🙄” opportunity to spend two weeks figuring out how to install hyperledger fabric on Kubernetes. There aren’t many guides on the internet besides this one. Unfortunately, I found it to be very vague and missing some keys steps. For this tutorial, let’s go step-by-step on how to install hyperledger on kubernetes. We are going to use some information from the guide linked above, along with some stuff my team and I were able to figure out along the way.