Category: Uncategorised

Sorting list of Java objects

In this post we will see how to sort a list of java objects using a property of the object. In this example we will sort the list of employees using their salaries. Employee: For sorting create stream of employees and invoke sorted method. Output:

Reading a text file in Java

File handling has become easy in Java. In this post we will see how to read the file contents as stream of strings and to print the contents from the streams. We will be using lines method from Files class. Output:

Better Testcontainer Support – Spring Boot 3.1

Testcontainers is an open source framework for providing throwaway, lightweight instances of databases, message brokers, web browsers, or just about anything that can run in a Docker container. Using Testcontainers, tests can be run against real dependencies without need for mock or environment configurations. In this post we will see how to use Testcontainers for […]

Spring Boot PostgreSQL Example

PostgreSQL is a powerful , open source relational database system. In this post we will see how to build REST API using Spring Boot with PostgreSQL database. From the Spring initializr create a project with the below shown dependencies To configure Spring Boot to use postgreSQL: Entity: Let’s create StudentRepository Defined below API’s Service layer: […]

Deploying Machine Learning Models using Streamlit

Streamlit is an open-source framework for Machine Learning and Data Science teams to create applications with python. Streamlit Community Cloud launches apps directly from the GitHub repo. Github repo should contain app code and dependencies details. To deploy an app, we should click “New app” from the upper right corner of the workspace, then fill […]

Spring Cloud AWS – File upload to S3

Spring cloud AWS simplifies using AWS managed services in a spring and spring boot applications. S3 is used to store files in a cloud. Spring Cloud AWS provides a spring boot starter to auto-configure the various S3 integration related components. Spring Cloud AWS BOM for the starter: Used S3Template to upload file to S3. Spring […]

REST API Automation Testing using Java

In this post we will see how to perform automation testing of REST API using Java. We will use the below sample API of get employees list. To perform the automation we will use the Java’s HttpURLConnection. HTTPURLConnection from java.net package is a URLConnection along with support for HTTP-specific features. It can be used to […]

Apache Kafka Installation

In this post we will go through the details of Apache Kafka installation on windows machine Download Apache Kafka from the url https://kafka.apache.org/downloads To start Apache Kafka with ZooKeeper follow the below steps

Spring Webflux V3 REST API Documentation + Swagger using OpenAPI3 V2

Springdoc-openapi library helps to automote the generation of REST API documentation . For Spring boot V3 we need to use springdoc-openapi V2 .  For integration between spring-boot and swagger-ui add the below dependency . Then the swagger will be available  at http://server:port/context-path/swagger-ui.html Sample API: After running the application we can view the swagger using below url