Author: Rishi Khandelwal

Expose Prometheus metrics for an Akka HTTP application

Reading Time: 2 minutes Application monitoring is an essential thing to keep the application available every time. We can do application monitoring through multiple ways such as through healthcheck endpoint, exposing metrics etc. Here, in this blog, we will see, how we can expose the metrics in Prometheus format for an Akka HTTP application. First, we need to add below maven dependency in pom.xml: pom.xml: Then, we need to Continue Reading

Alpakka: Process big CSV files using Akka Streams

Reading Time: 3 minutes In this big data world, we have lots of data, and generally, that data comes in CSV files. So as the data is huge, so the CSV files will also be huge. It will not be feasible to load that CSV file into memory in one go. So here the challenge comes, that how should we read those big CSVs. I got the same use Continue Reading

Import multiple CSV files into the Postgres through Java/Scala code.

Reading Time: 2 minutes It’s pretty simple to ingest data in the Postgres using the insert query, but in the big data world, we have a lot of data that we can not insert using insert queries. We get the data in CSV files that we want to import directly to the Postgres. It will take a lot of effort and time if we will try to import these Continue Reading

Java 9: Get more power with Java 9 Stream API Enhancements

Reading Time: 3 minutes We discussed the Optional API enhancements in my previous blog. In this blog, we will discuss the Stream API enhancements in Java 9. Stream API was introduced in Java 8 which gives us the power of using the collections in a declarative manner. We use the high order functions in the Stream APIs. In Java 9, they have introduced some more features: dropWhile() takeWhile() iterate() Continue Reading

Java 9: Enhance your Java 8 code with Java 9 Optional API enhancement

Reading Time: 3 minutes I am using Java 8 for quite a long time now. I started with Scala and then later worked on Java 8. I noticed that some of the features are very strong in Scala which is not in Java 8. I would like to discuss one of the features here which is Optional. Java introduced Optional in Java 8 but with some limited power but Continue Reading

Functional Java: Let’s understand the higher-order function

Reading Time: 3 minutes Higher-order function is an essential part of the functional programming paradigm. We must have defined a lot of functions in any language where we pass either primitive types or an object as an argument and returns the same. These are normal functions or methods. Then comes first-class functions. First-class functions are the functions that are treated as values. It means, those functions can be assigned Continue Reading

Functional Java: Should I really start using the functional paradigm in Java?

Reading Time: 5 minutes I am pretty sure, at some point, you must have had this question in your mind because everywhere, it is functional programming, immutability, higher-order functions, and blah blah. As a java developer, you must have confused, whether should I move to the functional programming paradigm? What are the benefits it provide to us? People are talking about it everywhere. So let’s give it a try Continue Reading

Functional Java: How to use a List in a functional way vs the imperative way

Reading Time: 3 minutes In my previous blog, we discussed how we can traverse a list in a functional way. There, first, we saw how we can do it in an imperative way and then moved ahead by modifying the code to reach the functional way. In this blog, we will explore some more uses cases of a list in a functional way and will compare it with the Continue Reading

RAP: Let’s discuss the architecture and technical details

Reading Time: 4 minutes In the previous blog, we discussed the journey and the features of RAP. In this blog, we will discuss the architecture and technical details. RAP Architecture: We have tried to follow the Domain-Driven Design and Reactive principles in designing RAP architecture. All RAP team members completed all the Reactive Architecture courses launched by Lightbend on cognitive classes to ensure adherence to reactive principles. These courses Continue Reading

RAP: The journey from a learning project to a useful product

Reading Time: 4 minutes A few months back, I was working on interesting customer engagement. Lagom was getting popularity, therefore, I and my few team members wanted to explore it to see if it would suit our needs. Just reading its documentation was not enough to get the proper practical hands-on. So we thought to do a project. The idea was that we should not build a dummy project, Continue Reading

Functional Java: Traversing a list in a functional way

Reading Time: 3 minutes In this blog, we will see how we can traverse a list in Java in a functional way. Iterating through a list is a basic operation on a collection, but over the years it’s gone through a few significant changes. We’ll begin with the old style and evolve an example—enumerating a list of names—to the elegant style. Let’s create a list first: final List<String> players = Arrays.asList(“Virat”, Continue Reading

Reactive Spring: Define a REST endpoint as a continuous stream

Reading Time: 2 minutes In the REST APIs, all Http requests are stateless. We fire the request and get the response, That’s it. It does not keep any state for any HTTP request. The connection between client and server is lost once the transaction ends, so 1 response for 1 request. But sometimes, we get the requirement to have a continuous response for a single request. This continuous response Continue Reading

Access multiple couchbase buckets from a Reactive Spring Boot application

Reading Time: 2 minutes A few days ago, I got a situation where I needed to access more than one couchbase bucket from a single reactive spring boot (Spring Web-flux) application. It is all about configuration. So, first of all, we will see how we can access a single couchbase bucket and then will move forward to access multiple buckets. Access Single bucket: To access a single bucket,  we Continue Reading