Jun 29Simplify Model Mapping in Spring Boot with MapStruct and LombokIntroduction: In Spring Boot applications, one common task is mapping data between different layers of an application, such as DTOs (Data Transfer Objects) and entities. This mapping process can be repetitive and time-consuming, but luckily, there are powerful libraries available to simplify the task. In this blog, we’ll explore how to…Mapstruct3 min readMapstruct3 min read
Jun 29Spring boot API architecture (part 1) — request/bean validation and JPA buddy tipsThis is a simple demonstration of one way of handling and validating the api requests (Bean validation) on controller in Spring boot. Start by adding the required maven dependencies <!--lombok--> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.26</version> </dependency> <!--validation--> <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>2.0.1.Final</version> </dependency> <!--JPA--> <dependency>…Spring Boot3 min readSpring Boot3 min read
Jun 10Database Auditing in Spring boot with spring security context and spring data JPAIntroduction Auditing in a database involves keeping track of the user who performs certain operations on the data, such as inserting, modifying, or deleting entries, as well as the time those actions were taken. This information can be useful for various purposes, such as security and compliance. In Spring Boot, auditing…Spring Boot5 min readSpring Boot5 min read
May 22Adding security to micro-services — Spring boot (Gateway filter) + JWT authentication (Part 2)This is the second part of my previous article about creating micro-services with spring boot framework- Spring cloud micro-service architecture with Api Discovery and Api Gateway using Netflix Eureka Microservice architecture is a software development approach that structures applications as a collection of small…mayankposts.medium.com Now we will add some security to prevent unauthorised access to out services(apis). As we are talking about micro-services which means that we should and have a stand-alone authentication service to provide authentication mechanism…Spring Boot4 min readSpring Boot4 min read
Apr 30Spring cloud micro-service architecture with Api Discovery and Api Gateway using Netflix EurekaMicroservice architecture is a software development approach that structures applications as a collection of small, independent services that communicate through APIs. Each microservice performs a specific business function and can be deployed and updated independently of the other services. This approach allows for greater flexibility, scalability, and resilience in complex…Microservices8 min readMicroservices8 min read
Mar 4Prepare AWS EC2 Ubuntu instance for running WAR archives on Apache Tomcat server with MySQL databaseInstalling JAVA sudo apt install openjdk-17-jre-headless java -version Setting JAVA_HOME environmental variable Check the list of all installed java versions and copy the desired path. sudo update-alternatives --config java Sample output: /usr/lib/jvm/java-17-openjdk-amd64/bin/java 2. Open environment file sudo nano /etc/environment 3. Add the Java path to end of the file Remove the /bin/java…Java2 min readJava2 min read