Browsed by
Category: Spring Boot

How to Implement JWT Token Based Authentication in Spring Boot Microservices

How to Implement JWT Token Based Authentication in Spring Boot Microservices

JWT (JSON Web Token) tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties. It is highly recommended and used authentication method for REST API & Webservices. Today we are going to see how to implement JWT token based authentication in spring boot microservices to securely communicate and transfer the data’s between the client(any client applications, angular/react/vue in modern application world) and server side applications. Though process for Token Based Authentication Spring security is needed…

Read More Read More

474 total views, 2 views today

Creating a SOAP web service with Spring Boot

Creating a SOAP web service with Spring Boot

Creating a SOAP web service with Spring Boot Main Application Spring Boot File: package com.ngdeveloper; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class CouponApplication { public static void main(String[] args) { SpringApplication.run(CouponApplication.class, args); } } pom.xml file: This below pom.xml file contains the plugin to generate the output directory files from the xsd file, so create the pom.xml, xsd file, endpoints then by starting your spring boot application you will be able to find the other required files generated. These are…

Read More Read More

1,085 total views, 6 views today

2 ways to refer classpath resource in spring boot projects

2 ways to refer classpath resource in spring boot projects

2 ways to refer classpath resource in spring boot projects   Using ClasspathResource import org.springframework.core.io.ClassPathResource; @Bean public XsdSchema mySchema() { return new SimpleXsdSchema(new ClassPathResource("myfile.xsd")); }   Note: Here myfile.xsd should be located in src/main/resources. Using Resource import org.springframework.core.io.Resource; @Value("classpath:myfile.xsd") private Resource res; @Bean public XsdSchema mySchema() { return new SimpleXsdSchema(res); } 966 total views, 2 views today

966 total views, 2 views today

How to create a Simple RabbitMQ listener in Spring boot ?

How to create a Simple RabbitMQ listener in Spring boot ?

How to create a Simple RabbitMQ listener in Spring boot ?   We are going to create a simple rabbitmq listener in the same spring boot project, but general usecase would be to use rabbitmq is between different microservices / different spring boot projects. This is to make a understanding of how to use rabbitmq and what are all things we need to do for a rabbitmq connectivity.   Prerequisite: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId> </dependency> Step 1: Declare a queue name…

Read More Read More

962 total views, no views today

Spring Boot Tutorials

Spring Boot Tutorials

Spring Boot Tutorials: 1. Spring Boot – Is it a Brand New Framework ? Spring boot is not a brand new framework, just like mvc/web/rest/jpa add-ons, it’s just a additional kit from spring to reduce the development headaches with spring framework. 2. How to configure spring boot in Maven ? Spring boot provides single dependency entry for pom.xml configuration, <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.10.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> Here this downloads all the dependencies required for web spring…

Read More Read More

2,031 total views, no views today

Scheduler in Spring Boot with 3 Simple Steps Example

Scheduler in Spring Boot with 3 Simple Steps Example

Scheduler in Spring Boot with 3 Simple Steps Example: Scheduler in spring boot became very simple and any one create a Cron job or scheduler in spring boot with just 3 steps. Step 1: Enable spring boot for schedules Add @EnableScheduling to your spring boot main class. @SpringBootApplication @EnableScheduling public class SpringBootStarter{ public static void main(String[] args) { SpringApplication.run(SpringBootStarter.class, args); } } Step 2: Create a cron job component: import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @Component public class CronJobSchedules…

Read More Read More

972 total views, no views today