Posts

Showing posts from November, 2021

Java Generic

Image
                                                                   Java Generic  Basic Examples   Generic Class Example: NEW In this example, Box is a generic class that can hold a value of any type. The <T> in Box<T> is a type parameter, and it represents the type that will be specified when creating an instance of the Box class. Here's how you can use it:   Generic Class Example with supper class:  NEW In this example: We have a generic class called StorageBox<T>, which extends a non-generic superclass Box<T>. T is the type parameter that is inherited from the superclass. The StorageBox class has an additional field called storageLocation to store information about the storage location of the item. The constructor of StorageBox takes both the value and the storage location a...

Kafka - Kafka Streams vs. Kafka Consumer

Image
Kafka Streams vs. Kafka Consumer 1. Introduction Apache Kafka  is the most popular open-source distributed and fault-tolerant stream processing system. Kafka Consumer provides the basic functionalities to handle messages.  Kafka Streams  also provides real-time stream processing on top of the Kafka Consumer client. In this tutorial, we'll explain the features of Kafka Streams to make the stream processing experience simple and easy. 2. Difference Between Streams and Consumer APIs 2.1. Kafka Consumer API In a nutshell,  Kafka Consumer API  allows applications to process messages from topics.  It provides the basic components to interact with them, including the following capabilities : Separation of responsibility between consumers and producers Single processing Batch processing support Only stateless support. The client does not keep the previous state and evaluates each record in the stream individually Write an application requires a lot of code No ...