Posted In: Spring, Spring REST

Spring Asynch Rest Client – Using Apache HTTPComonents library example2

Usecase Application needs to use Apache HTTP Component library to call REST services. Spring provides HttpComponents factory to do that. By default Spring will use default JDK capabilities to call REST services. Maven entry for httpasyncclient  

Read More

Tags: Tags:

by , on July 24th, 2017

Posted In: Spring, Spring REST

Spring Asynch Rest Client – Using Netty library example1

Usecase Application needs to use Netty library to call REST services. Spring provides Netty factory to do that. By default Spring will use default JDK capabilities to call REST services. Maven entry for netty  

Read More

Tags: Tags:

by , on July 23rd, 2017

Posted In: Spring, Spring REST

Spring Asynch Rest Client – Using Apache HTTPComonents library example1

Usecase Application needs to use Apache HTTP Component library to call REST services. Spring provides HttpComponents factory to do that. By default Spring will use default JDK capabilities to call REST services. Maven entry for httpasyncclient  

Read More

Tags:

by , on July 23rd, 2017

Posted In: Spring, Spring REST

Spring Rest Template – BasicAuthorizationInterceptor Example

Usecase Call to the service needs basic authorization headers. You need not set these headers in each request separately but achieve it by one single BasicAuthorizationInterceptor   Output. Observe Basic authorization header being added to the request

Read More

Tags:

by , on July 21st, 2017

Posted In: Spring, Spring REST

AsyncRestTemplate – Rest call with ResponseExtractor, AsyncRequestCallback

Usecase Your application calls rest service which takes some time to complete. You need to respond to the client with received message immediately. Once you receive the response do some action.

Read More

Tags: Tags:

by , on July 20th, 2017

Posted In: Spring, Spring REST

AsyncRestTemplate – Callback

Usecase Your application calls rest service which takes some time to complete. You need to respond to the client with received message immediately. Once you receive the response do some action. OUTPUT – Body printed after Callback

Read More

Tags: Tags:

by , on July 19th, 2017

Posted In: Spring, Spring REST

AsyncRestTemplate – Multiple Rest Calls

Usecase 1. Multiple REST services needs to be called to get all data. e.g. First service returns Name. Second service returns Address. Response needs both Name and Address 2. Both services are independent to each other. 3. Service response time is high In these cases we could use AsyncRestTemplate. Please note : Call to ListenableFuture..get() […]

Read More

Tags: Tags:

by , on July 18th, 2017

Posted In: Spring, Spring REST, Spring Security

Spring REST – Difference in request parameter and path variable

We will talk about design level as well as organizational security/policy level differences in these two options. Example of Path Variable Example of Request Paramter   You can pretty much use either path variable or request param to design your service. Though there are some organizational level restrictions that we may face while taking that […]

Read More

Tags:

by , on July 12th, 2017