Posts

Showing posts from March, 2018

Docker fundamentals

Image
Nowadays everybody is talking about Docker. Some people are well versed with docker concepts and have hands on it and some have started learning docker. So what is Docker?. As per the official docs from docker, Docker is a platform for developers and sysadmins to develop , deploy , and run applications with containers. So what does make it different. We were already doing that since long . When we are deploying application on servers we have to deal with setting up new VM , configuring dependencies / libraries, environment variables. Docker makes this thing easy for you, by providing OS level virtualization (aka. containerization). So basically you can create Docker images that will have all your resources ( env. variables / libs / running on what port). Then you can deploy your application inside docker container anywhere without even worrying about the dependencies. In traditional way you have to setup separate VM and then install all the required software and have

Spring RestTemplate : Follow Redirect Automatically

Follow Redirect Automatically in Spring RestTemplate.... Now since the boost of micro-service based architecture we use web-services a lot. Spring boot is one of the popular framework to work on Micro-service based architecture. Soap web-services are legacy swords and REST( Representational State transfer ) is now the modern time weapon in everybody's arsenal. When we use REST with Spring we have lot of inbuilt functionalities (Converting Response and request to Domain objects, Error handling, HttpStatus code and many more...) offered by Spring. Today we are going to check about RestTemplate. Spring's central class for synchronous client-side HTTP access. This is what Spring says about RestTemplate. RestTemplate provides support to all HTTP Methods. Most popular are GET and POST. So when we are calling any webservice endpoint using RestTemplate GET or POST there are chances that in response you get Redirect response (302 HTTP Status code). Which indicates that this