Parallelism Example in Java Stream API

I am going to show you how to work with parallel stream in Java 8 or higher version of Java. In parallel computing a task is divided into sub-tasks and these sub-tasks are computed parallelly in each separate threads and finally the result of the solution for each sub-tasks is combined. One of the features for computing parallelism is to…

Python Client for Apache Kafka Producer and Consumer

Introduction In this tutorial I am going to show you how to use Python client to work with Apache kafka distributed stream processing system. I will create Kafka producer and consumer examples using Python language. KafkaConsumer is a high-level message consumer that consumes records from a kafka cluster. The consumer is not thread safe and should not be shared across…

Find Unique Strings Or Objects Using Java Stream API

Unique Strings/Objects In this tutorial you will see an example on how to find unique strings or objects using Java stream API. Stream API was introduced in Java 8 and I am going to show you how to use this stream API to remove duplicates from strings or objects. Java stream API has a method distinct() that removes duplicates and…

Event Driven Streaming using Spring Cloud Stream and Apache Kafka

In this tutorial we will see an example of event driven streaming using Spring Cloud Stream and Apache Kafka streaming platform. How do we deal with some events, such as, a new user has registered to a portal, an order was placed, a file has been uploaded etc? Let’s say when an order was placed then we need a call…

Convert List of Map Objects Into List Of Objects Using Java Stream

Map To List Objects Here I will show you how to convert List of Map objects into List of objects using Java 8’s or later’s Stream API. The List of Map objects can be found as a result of selecting multiple records from database table or any other sources. Then you may need to convert into List of objects to…

Collect and Convert Objects using Lambda Expression in Java 8 or Later Version

Introduction In this tutorial, I will show you how you are going to collect and convert objects using lambda expression in Java 8 stream API. I will collect objects and map to another custom objects using Java 8 stream API with the help of Lambda Expression. Suppose you have entity classes generated from your database tables and after fetching data…

Java 8 Stream Filter Example

Java 8 Filter This tutorial will show you how to use Java 8 stream API‘s filter() and map() methods. The filter() method in Java 8 or onward is used to produce a stream containing only a certain type of objects into the result output and map() method is used to transform a stream from one type to another type into…

Java 8 Stream API

Introduction In this tutorial I will explain about Java’s new API called stream, which was introduced in Java 8 and included in package java.util.stream. The stream API supports functional-style operations on collection of elements or stream of elements in a collection.

How to read input through keyboard in Java

This tutorial shows how to read input from keyword using Java programming language. For example if your database connection string changes then you don’t need to worry because for any database connection string like username and password, this will still work. This is a simple example, you can customize as per your need. You can also apply validation on each…