Posts

Showing posts from September, 2018

Kafka Producer JAVA code

Image
In the last post What is Apache Kafka , we discuss Kafka producer, Topics and Consumers. In this post, I am going to provide JAVA code for writing Kafka Producer and explain how it works. In this code, we are going to send data from CSV row by row to Kafka Topics for further consumption by Kafka Consumer . In this way, we can generate the continuous streams of Data. 1. First, you need to create a Kafka Topic. You can either do it from the console or do programmatically. Please go through the basic Quickstart from  Apache Kafka Website  and create Topics, send basic message from producer and consume it at consumer. Once, you have created Topic, its time to write Kafka Producer, which will send data to Topic. For creating Procuder we need to configure it some parameters. Lets, look at the configurations required for creating producer 1. List of Kafka Brokers 2. Serializer used for sending data to Kafka 3. Acknowledge from Kafka that messages are properly received.

What is Apache Kafka?

Image
Kafka is a fast, scalable, durable, and fault-tolerant publish-subscribe messaging system that sends messages between applications, processes, and servers. It is composed of three important components called producer (which acts as Sender), Topics (topic or category of messages), and Consumer (which acts as a Reciever) . Kafka aims to provide high-throughput, low latency for real-time data feeds. It is widely used for real-time streams analytics, ingestion data into Spark, Complex Event Processing, Log aggregation, etc. Before understanding Kafka Architecture, lets first understand what Kafka Broker is Kafka Broker: As Kafka is a distributed framework, Kafka's cluster consists of different servers called Brokers running Kafka. Producers publish the message to Kafka Topics within this Broker and consumer consumes this message from Topics. Kafka Architecture: Kafka Architecture is comprised of mainly 3 components Kafka Producer Kafka Topics Kafka Consumer

5 JAVA Technical Interview Questions

In this post, I am going to discuss the top 5 JAVA interview technical questions that are frequently asked in the technical interview of big IT companies that are looking for JAVA developers. 1.  What is Method Overriding in JAVA? One of the most common technical interview questions 1. Method overriding is used to enable sub-class to use same Method name, same number, and type of arguments and same return type of super-class 2. It is run-time polymorphism 3. The methods must have the same signature. Example: class Book { void run(){ System.out.println(“Book is issued”); } Class MathBook extends Book{ void run() { System.out.prinltn(“MathBook is issued to Maths Student”); } public static void main( String args[]) { Book b=new MathBook(); b.run(); } } 2. What are Threads in JAVA? How to create Threads? Again very important IT interview question A thread is an independent and isolated path of execution in a single program. Many threads

5 Python Technical Interview Questions

Python is the most widely used programming language nowadays and it is one of the favorite languages among developers. Also, with the latest growth in Big data, Data Science, and Machine Learning, python is most popular in the Big Data community. So, companies working with Big Data expect knowledge of python, and concepts of python are frequently asked in interviews.  In this post, I will share the technical questions interview experience and  top 5 basic python technical questions which are frequently asked in many technical interview. 1. Describe Memory Management in Python It is one of the most common IT interview questions. Memory management in Python involves a private heap containing objects and data structures. The management of this private heap is handled by the Python memory manager. Python memory management also deals with various dynamic storage aspects like sharing, segmentation, and pre-allocation. The programmer doesn't have access to private heap storage and t