Simple Delete example

In this post under Spring WebClient, I will explain with example how to perform simple DELETE HTTP request. Below is the complete code for your reference. Main class 1 package defaultPackage; 2 3 import org.springframework.web.reactive.function.client.ClientResponse; 4 import org.springframework.web.reactive.function.client.WebClient; 5 6 import reactor.core.publisher.Mono; 7 8 public class Example4 { 9 public static void main(String[] args) throws…… Continue reading Simple Delete example

Simple Put example

In this post under WebClient, I will show with example how to make a simple PUT HTTP request using WebClient framework. Below is the complete main method for your reference Main class 1 package defaultPackage; 2 3 import org.springframework.web.reactive.function.client.WebClient; 4 import reactor.core.publisher.Mono; 5 6 public class Example3 { 7 public static void main(String[] args) throws…… Continue reading Simple Put example

Simple Post example

In this post under WebClient, I will show with example how to make a simple POST HTTP request using WebClient framework. Below is the complete main method for your reference Main class 1 package defaultPackage; 2 3 import org.springframework.web.reactive.function.client.WebClient; 4 import reactor.core.publisher.Mono; 5 6 public class Example2 { 7 public static void main(String[] args) throws…… Continue reading Simple Post example

Simple Get example

In this post under WebClient, I will show with example how to make a simple GET HTTP request using WebClient framework. Below is the complete main method for your reference Main class 1 package defaultPackage; 2 3 import org.springframework.web.reactive.function.client.WebClient; 4 5 import reactor.core.publisher.Mono; 6 7 public class Example1 { 8 public static void main(String[] args)…… Continue reading Simple Get example

assumingThat example

In this post under JUnit, I will explain the purpose of “assumingThat” assertion method. In my previous postAssumptions in JUnit 5 I showed you how to use “assumeTrue” and “assumeFalse” assumption statements. Lets add that code here again for recap Below is the class to be tested. MockUserRepository package package14;public class MockUserRepository { private boolean…… Continue reading assumingThat example

Object Pool addObject method example

In this post under Apache Pool, I will explain with example the purpose of “addObject” method in Apache Pool. In Apache Pool we can create three types of object Pool1) GenericObjectPool2) GenericKeyedObjectPool3) SoftReferenceObjectPool All these classes support “addObject” method. Now lets understand the purpose of this method. If you refer to all my previous post,…… Continue reading Object Pool addObject method example

Configuring Generic Object Pool

In this post under Apache Pool, I will show how to create GenericObjectPool instance with custom configuration In all post under Apache Pool, I showed how to create GenericObjectPool using default configuration. When we use the below code snippet, we are creating an object pool with default configuration. GenericObjectPool<Thread> genericObjectPool = new GenericObjectPool<Thread>(threadPooledObjectFactory); To change…… Continue reading Configuring Generic Object Pool

Creating a soft reference object pool

In this post under Apache Pool, we will explain with example how to create soft reference object pool. For our example we will create the below thread factory class that extends Apache Pool framework’s “BasePooledObjectFactory” class. package package6;import org.apache.commons.pool2.BasePooledObjectFactory;import org.apache.commons.pool2.PooledObject;import org.apache.commons.pool2.impl.DefaultPooledObject;public class ThreadPooledObjectFactory extends BasePooledObjectFactory<Thread> { private int count = 0; @Override public Thread create()…… Continue reading Creating a soft reference object pool