# Pavan Kumar Jadda ## Posts - [Native fetch wrapper in React and JavaScript](https://pavankjadda.dev/native-fetch-wrapper-in-react-and-javascript/): In modern web development with React, interacting with backend APIs is a fundamental task. While the browser’s built-in fetch API provides the basic functionality, it can become repetitive and cumbersome to handle tasks like setting headers, managing authentication, and implementing consistent error handling across your application. This blog post will guide you through building a […] - [Run same JUnit test with multiple roles using Spring Security](https://pavankjadda.dev/run-same-junit-test-with-multiple-roles-using-spring-security/): When building enterprise applications with Spring Boot and Spring Security, it’s common to implement role-based access control (RBAC). But how do we test the same endpoint with different roles—without duplicating your test code? Enter JUnit parameterized tests. In this post, we’ll walk through testing an employee reassignment feature, showing how to execute the same JUnit […] - [Create reusable annotations in Spring Boot](https://pavankjadda.dev/create-reusable-annotations-in-spring-boot/): In Spring Boot and Java have many in built in annotations. Annotations in Java are a form of metadata that provide data about a program but are not part of the program itself. They have no direct effect on the operation of the code they annotate. We can create custom annotations by extending current one […] - [Signal Inputs in Angular](https://pavankjadda.dev/signal-inputs-in-angular/): Overview Angular introduced signal inputs in 17.1.0 minor release. Signal inputs provide reactive behavior to component inputs by tracking changes whitout need of implementing OnChange interface In traditional Angular components, inputs are usually managed via the @Input() decorator. With the new reactive paradigm, Angular introduced Signal Inputs to bring signals directly into the input flow […] - [How to save Hibernate Entity changes to Database](https://pavankjadda.dev/how-to-save-hibernate-entity-changes-to-database/): The common requirement in enterprise application is to store changes of an entity in separate table in structured way. There are multiple to achieve this This blog post explains the process to store entity/table/domain changes in separate table using EntityListener. We can implement EntityListener in 2 ways Motivation Imagine a simple Spring Boot book store […] - [RestClient in Spring Framework 6.1](https://pavankjadda.dev/restclient-in-spring-framework-6-1/): Note: This is work in progress Spring Framework 6.1 M2 debuts the RestClient, a fresh synchronous HTTP client. As its name implies, the RestClient provides the smooth WebClient API while leveraging the foundation of RestTemplate. With this we have 3 HTTP clients in Spring Framework. RestTemplate Around fourteen years ago, Spring Framework 3.x introduced RestTemplate […] - [How to use Playwright with Angular for e2e testing](https://pavankjadda.dev/how-to-use-playwright-with-angular-for-e2e-testing/): Angular officially announced the deprecation of Protractor in December 2020 with the release of Angular version 11. They recommended to use other tools offered by the community. Two of the popular choice among these are In this blog post we learn how to setup playwright with Angular and write e2e test cases. Install Playwright Install […] - [Required inputs in Angular 16 or later](https://pavankjadda.dev/required-inputs-in-angular-16-or-later/): In Angular 16, a new feature has been added which allows for the specification of required inputs for components and directives. This means that certain inputs can be marked as necessary for a component or directive to operate as intended. Utilizing this feature helps guarantee that all critical data is available prior to the execution […] - [How to Deploy Angular SPA in NodeJS with Docker](https://pavankjadda.dev/how-to-deploy-angular-spa-in-nodejs-with-docker/): The blog post will walk you through the steps to deploy an Angular SPA in Node.js using Docker. By the end of this tutorial, you’ll have a fully functional Angular SPA running in a Docker container, ready to be deployed to production. That being said Angular single page applications can be deployed in many ways. […] - [Dynamically Update Angular Environment Variables Using Docker Env Variables](https://pavankjadda.dev/dynamically-update-angular-environment-variables-using-docker-env-variables/): In Angular the BASE/API URLs are be stored environment files which are present under src/environments directory. Usually we can create new file for each environment. environment.ts During the build, a configuration flag is provided to swap the default environment.ts file with environment.<CONFIGURATION>.ts based on the flag The problem with this approach is you can’t reuse […] - [Schedule tasks in Spring Boot with @Scheduled annotation](https://pavankjadda.dev/scheduled-annotation-in-spring-boot/): Spring Boot is a popular framework that provides an easy way to create web applications. It offers a lot of features that make development easier and faster. One of these features is the ability to schedule tasks using the @Scheduled annotation. In this article, we will explore this feature and provide some examples. See spring […] - [Unit and Integration test Spring Boot applications with Spring Testing and JUnit](https://pavankjadda.dev/unit-and-integration-test-spring-boot-applications-with-spring-testing-and-junit/): This blog post explains the process to Unit test and Integration test Spring Boot application with JUnit and Spring Testing library Unit Tests Typical Spring Boot application divided into 3 layers Repository layer Testing Let’s start with Repository layer. See below example. The above test class show cases Employee Repository class. We use DataJpaTestannotation for this. […] - [Multi Stage Docker builds with Angular and Nginx](https://pavankjadda.dev/multi-stage-docker-builds-with-angular-and-nginx/): This blog post shows multi stage Dockerfile that builds and deploys Angular app in Nginx container Dockerfile: The above Dockerfile has 2 stages Stage 1 – install NPM dependencies and builds Angular project Stage 2 – Builds docker image from dist directory generated by previous stage Stage 1: Install dependencies and Build Angular project and you can […] - [Using OpenJ9 containers in Production (Spring Boot)](https://pavankjadda.dev/using-openj9-containers-in-production-spring-boot/): I read some good things about OpenJ9 in their website and decided to give it a try. In my tests I found out OpenJ9 JVM is using almost half of the memory of Hot Spot JVM. Setup My Spring Boot application deployed in Docker Swarm cluster which 3 nodes, each node has decent specs. To test this, I used adoptopenjdk:11-jre-openj9-bionic docker […] - [React Cookies management with simple hooks](https://pavankjadda.dev/react-cookies-management-with-simple-hooks/): This blog post explains the process to maintain cookies in React application using simple hooks from react-cookie-service library react-cookie-service is a simple react library with 5 hooks that helps to read, set, and delete cookies Usage Install the library using npm or yarn command 2. To get one specific cookie by name, use getCookie hook. Which returns cookie in string […] - [Authorization Guards with React Router](https://pavankjadda.dev/authorization-guards-with-react-router/): Authorization guards prevent unauthorized users from accessing the web page when they are not supposed to see it and redirect them to unauthorized page. First, define Routes as follows with React Router. It has 4 types of routes The system supports 3 types of users Each type of user routes are protected by different route guards. For […] - [Docker Swarm continuous deployment using native service health checks](https://pavankjadda.dev/docker-swarm-continuous-deployment-using-native-service-health-checks/): This blog post explains the process to configure the Docker service health checks using native docker service commands. Docker swarm is a container orchestration tool similar Kubernetes, OpenShift, ECS, EKS and it comes as part of Docker engine. Read more about swarm in official docker docs Create swarm cluster Swarm cluster contains at least one master […] - [Event Sourcing and Materialized views with Kafka Streams](https://pavankjadda.dev/event-sourcing-and-materialized-views-with-kafka-streams/): Kafka helps you to build fast, high throughput, fault tolerance, scalable microservices, and applications. Kafka Streams stores data in Kafka Clusters (Kafka State Stores) and gets data wicket fast. Technologies Used Overview This repository demonstrates CQRS Event Sourcing (Materialized views) with Kafka Streaming (Version: 2.1.0) In a typical production environment, we have multiple microservices and we want […] - [Synchronous and Asynchronous Data access using ThreadPoolExecutor and Spring Boot, Spring Data](https://pavankjadda.dev/synchronous-and-asynchronous-data-access-using-threadpoolexecutor-and-spring-boot-spring-data/): Overview Java multi-threading requests the Operating System to create and destroy threads. Using multiple threads to execute multiple tasks is an efficient way to use CPU and gives a real performance boost to the application. This blog post explains the process to access data Synchronous and Asynchronous manner using ThreadPoolExecutor. The primary motive behind to use […] - [Angular SSR with Angular Universal and Deploy with Docker](https://pavankjadda.dev/angular-ssr-with-angular-universal-and-deploy-with-docker/): This blog post explains the process to enable Angular Server Side Rendering(SSR) with Angular Universal and the process to deploy it in Docker container The source code of the application demonstrated in this post present in Github Setup Angular Application If you already have an existing Angular application, you can skip this step 2. Add Angular material […] - [Keycloak with Angular and Spring Security](https://pavankjadda.dev/keycloak-with-angular-and-spring-security/): Keycloak is one of the widely used Open Source Identity and Access Management application. This article demonstrates usage of Keycloak as authentication server with Angular, Spring Boot and Spring Security. As usual, code uploaded to Github repository Technologies: Prerequisites: Setup: 3. Go to http://localhost:8080 to login into Keycloak admin console and use the following credentials. Same can be configured […] - [How to setup EFK stack on OpenShift Origin?](https://pavankjadda.dev/how-to-setup-efk-stack-on-openshift-origin/): Elasticsearch, Fluentd, and Kibana (EFK) stack is one of the popular and recommended for centralized logging in OpenShift Origin (OKD) cluster. It is similar to ELK Stack but uses Fluentd instead of logstash. This blog post explains the process to use Fluentd to collect, transform, and ship log data to the Elasticsearch backend. Fluentd is a popular open-source data collector […] - [JWT authentication in Spring Security and Angular](https://pavankjadda.dev/jwt-authentication-in-spring-security-and-angular/): This blog post explains the JSON web token(JWT) authentication using Spring Security, Spring Boot, Spring Data and Angular. Source code uploaded to Github repository Introduction JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be […] - [Hibernate 2nd level cache with HazelCast, Spring Boot and Spring Data JPA](https://pavankjadda.dev/hibernate-2nd-level-cache-with-hazelcast-spring-boot-and-spring-data-jpa/): This blog explains the process to implement Hibernate 2nd level cache with HazelCast, Spring Boot and Spring Data JPA. Source code and config files are uploaded to Github Technologies Start HazelCast instance HazelCast instances are setup as Docker containers using the docker-compose file shown below. Start the HazelCast instances and management center using the following command. […] - [OAuth2.0 authentication with Spring Security, Angular and MySql](https://pavankjadda.dev/oauth2-0-authentication-with-spring-security-angular-and-mysql/): OAuth 2.0 is the industry-standard protocol for authorization. OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web applications, desktop applications, mobile phones, and living room devices. This blog post explains the implementation of OAuth2 authentication with Spring Boot, Spring Security and Angular. OAuth Roles OAuth defines four roles: Resource Owner: User The […] - [HashiCorp Vault authentication with Spring Cloud and Spring Boot](https://pavankjadda.dev/hashicorp-vault-authentication-with-spring-cloud-and-spring-boot/): This article explains HashiCorp Vault setup and usage with Spring Cloud and Spring Boot. Vault supports multiple authentication methods, in this article we will discuss 2 of those methods Update: Starting with Spring Boot 2.4.x, spring boot changed the way config files are processed. Updated the article to reflect the same. Technologies Vault setup – Standalone […] - [Deploy Spring Boot application with Jenkins pipeline on Open Shift Origin cluster](https://pavankjadda.dev/deploy-spring-boot-application-with-jenkins-pipeline-on-open-shift-origin-cluster/): Continuous Integration and Continuous Delivery (CICD) with Jenkins makes application delivery process easy and efficient without much manual effort. This blog post explains Spring Boot application deployment on Open Shift cluster (present on AWS) using Jenkins CICD pipeline. It has two major parts Prerequisites For this, to work we need have Open Shift cluster running […] - [Setup SonarQube with POSTGRES database using docker](https://pavankjadda.dev/setup-sonarqube-with-postgres-database-using-docker/): Both SonarQube and POSTGRES database should be same network in order communicate with each other. First create docker network using the following commands Create docker network Delete existing docker network and create new docker network sonarqube Run PostGres DB container Delete existing postgres docker container Run new postgres docker container Run SonarQube container Delete existing […] - [Easy way to run SQL Server on Mac or Windows via Docker](https://pavankjadda.dev/easy-way-to-run-sql-server-on-mac-or-windows-via-docker/): Running SQL Server on Docker is a great way to quickly set up a database for testing, development or even production use cases. Here are the steps to run SQL Server on Docker If you would like to create volume and persist the data, provide volume argument -v docker_mssql_volume:/var/opt/mssql 3. Replace <version> with the version […] - [Load initial schema and data to MySQL docker container on start up](https://pavankjadda.dev/load-initial-schema-and-data-to-mysql-docker-container-on-start-up/): To load initial schema and data to a MySQL Docker container on start-up, you can use the following steps: 5. Start the services defined in the docker-compose.yml file using the following command: 5. The MySQL Docker image includes a script, /docker-entrypoint.sh, that is executed on container start-up. This script will run any SQL files in […] - [Implement Hibernate 2nd level Cache with Redis, Spring Boot, and Spring Data JPA](https://pavankjadda.dev/implement-hibernate-2nd-level-cache-with-redis-spring-boot-and-spring-data-jpa/): This blog post explains the process of implementing Redis Cache as Hibernate 2nd level cache using the Spring Boot, Spring Data JPA. Source code and config files are uploaded to Github. Setup Redis 1.There are a couple of ways to set up Redis (i) Download the tar file and follow the instructions from official Redis docs for detailed step by step […] - [How to deploy Angular and Spring Boot apps behind Nginx proxy server](https://pavankjadda.dev/how-to-deploy-angular-and-spring-boot-apps-behind-nginx-proxy-server/): NGINX is a free, open-source, high-performance HTTP server and reverses proxy, as well as an IMAP/POP3 proxy server. NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption. This article explains the process to deploy Angular and Spring boot apps on Nginx server. In a nutshell, the process can be […] - [Search data across Multiple Columns using Spring Data JPA](https://pavankjadda.dev/search-data-across-multiple-columns-using-spring-data-jpa/): This blog post explains the process to search for data across multiple columns in a table using Spring Data JPA. Technologies There are 3 different ways to search for data across multiple columns in a table using Spring Data JPA Let’s take an example of Employee and Project tables. Create view EmployeeProjectView (mapped in database as employee_project_view) that […] - [Angular URL State management with Query Params and Route Params](https://pavankjadda.dev/angular-url-state-management-with-query-params-and-route-params/): This blog post explains the process to maintain state using browser URL. In Angular there are couple of different ways to manage the state But in some cases, you may want to share URL and let others see the exact list of items (same order and filters applied). For example, when search for a flight […] - [ngIf(Angular) and v-if (Vue) alternative in React](https://pavankjadda.dev/ngifangular-and-v-if-vue-alternative-in-react/): In Angular or Vue, you can render components conditionally using directives like ngIf and v-if. But in React there is no concept of directives, you have to render components using below syntax return ( <> {loading ? <></> : <EmployeeList/>} logged in. </> );} However if you have nested conditions, then the template looks messy and very hard […] - [How to fix “.gitignore not working” issue?](https://pavankjadda.dev/how-to-fix-gitignore-not-working-issue/): Sometimes git does not exclude files/folders added .gitignore especially if you had committed them before. Here is how to fix it. I am ignoring node_modules from frontend project as an example ### Format1 ###node_modules/node/### Format2 ###**/frontend/node_modules/****/frontend/node/** git rm -r --cached . git add .git commit -m "fixed untracked files" Note: Windows users make sure your .gitignore uses UTF-8 rather than UTF-16. […] - [Safely Evolving Database with Liquibase, Spring Data, and Spring Boot](https://pavankjadda.dev/safely-evolving-database-with-liquibase-spring-data-and-spring-boot/): Many implementations out there explaining the process to evolve the database with Liquibase and some of them implemented with Spring framework. I couldn’t find a simple and reliable implementation that explains the whole process. Overview This blog post explains the process to safely evolve Database with Liquibase, Spring Boot, and Spring Data JPA. Liquibase Maven plugin gives the ability […] - [Setup ELK Stack to capture Spring Boot logs](https://pavankjadda.dev/setup-elk-stack-to-capture-spring-boot-logs/): ELK stack is one of the good stack available to organize and visualize Spring Boot application logs. So, what’s ELK Stack? “ELK” is the acronym for three open source projects: Elasticsearch, Logstash, and Kibana. Elasticsearch is a search and analytics engine. Logstash is a server‑side data processing pipeline and Kibana lets users visualize data with charts […] - [Synchronous HTTP calls in Angular using Async and Await](https://pavankjadda.dev/synchronous-http-calls-in-angular-using-async-and-await/): Observables in Angular offer significant benefits over other techniques for event handling, asynchronous programming, and handling multiple values. But some times we may want to wait for the response from previous HTTP call or load default settings for an application. In that case, we use Async and Await functions to achieve this. This blog post […] - [HTTP Requests in Java](https://pavankjadda.dev/http-requests-in-java/): We have many libraries in Java to make HTTP requests and get information from external API. HttpClient This is added in Java 9 and latest LTS that has is Java 11. To use this, first build a request then make a request. OkHttpClient OkHttpClient is also similar to HttpClient and one of the popular one […] ## Pages - [Resume](https://pavankjadda.dev/resume/) - [Blog](https://pavankjadda.dev/blog/) - [Contact](https://pavankjadda.dev/contact/) - [Services](https://pavankjadda.dev/services/) - [About](https://pavankjadda.dev/about/) - [Home](https://pavankjadda.dev/): Mastodon Java, React and Angular developer with 10 years of experience in development and implementation of enterprise Java andWeb applications. Skill Set Java Spring Boot, Hibernate and Spring Data JPA Spring Security, Spring Session, Spring AOP, and Spring Webflux Java MicroServices with Spring Boot Apache Kafka, Kafka Streams API, Elastic Search MySQL, SQL Server and […] ## Optional - [Agent (MCP protocol)](websites-agents.hostinger.com/pavankjadda.dev/mcp) [comment]: # (Generated by Hostinger Tools Plugin)