Posts

Showing posts from April, 2025

Setup Kafka In Macos

OS : MacOS Sonoma - Silicon Chip Date: 26-April-2025 Install: brew install kafka Start Kafka To start kafka now and restart at login:   brew services start kafka Or, if you don't want/need a background service you can just run:   /opt/homebrew/opt/kafka/bin/kafka-server-start /opt/homebrew/etc/kafka/server.properties Create Topic vishesh@visheshs-MacBook-Pro bin % /opt/homebrew/opt/kafka/bin/kafka-topics --create --topic test-topic --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1 Created topic test-topic. Verify Topic creation vishesh@visheshs-MacBook-Pro bin % /opt/homebrew/opt/kafka/bin/kafka-topics --list --bootstrap-server localhost:9092 test-topic Sending Producer mauli@maulis-MacBook-Pro  bin % /opt/homebrew/opt/kafka/bin/kafka-console-producer --bootstrap-server localhost:9092 --topic test-topic >Hello Mauli >$(date) >`date` >Its fun mauli@maulis-MacBook-Pro  bin % echo "Trying to send Message to topic using Pipe Symbol with ...

S.O.L.I.D.

 Solid Principal Aims at designing application architecture in such a way so any new change made to application will not induce any defect S - Single Responsibility O - Open and Close Principal  - Abstract class could be extended without breaking or changing existing code L - Liskov Substitution Principle - Ensure subclass follow contract of parent class using Inheritence. I - Interface Segregation Principal - Use Mulitple Interfaces instead of Single Large Interface D - Dependency Inversion Principal - Use Dependency Injection and Interfaces to Depend on Abstraction. Example to demonstrate Liskov abstract class Vehicle {     abstract void start(); } class Car extends Vehicle {     @Override     void start() {         System.out.println("Car is starting...");     } } public class Main {     public static void main(String[] args) {         Vehicle myCar = new Car();       ...