ConnectableObservable’s refCount method

In this post I will explain “refCount” method with an example. In my previous posts under RxJava, I explained about ConnectableObservable’s “autoConnect” method. This method is similar to “autoConnect” method. By calling refCount is nothing but calling autoConnect and passing 1 as an argument. Observable<Long> observable = Observable.interval(1, TimeUnit.SECONDS); observable = observable.publish().refCount(); is similar to…… Continue reading ConnectableObservable’s refCount method

Spring Retry simple example (using annotation)

In this post under Spring Retry, I will explain how to configure Spring Retry framework into your application using annotation with simple example At minimum, you need the below jars in your classpath1) spring-retry-1.3.1.jar2) commons-logging-1.2.jar3) spring-core-4.3.22.RELEASE.jar4) spring-aop-4.3.22.REELEASE.jar5) spring-beans-4.3.22.RELEASE.jar6) spring-context-4.3.22.RELEASE.jar7) spring-expression-4.3.22.RELEASE.jar8) aspectjweaver-1.8.9.jar For the example I will use the below service class Service6 1 import org.springframework.retry.annotation.Retryable;…… Continue reading Spring Retry simple example (using annotation)

Spring Retry simple example (using builder pattern)

In this post under Spring Retry, I will explain how to configure Spring Retry framework into your application using builder pattern with simple example At minimum, you need the below jars in your classpath1) spring-retry-1.3.1.jar2) commons-logging-1.2.jar3) spring-core-4.3.22.RELEASE.jar4) spring-aop-4.3.22.REELEASE.jar5) spring-beans-4.3.22.RELEASE.jar6) spring-context-4.3.22.RELEASE.jar7) spring-expression-4.3.22.RELEASE.jar8) aspectjweaver-1.8.9.jar For the example I will the below service class Service1 class public class…… Continue reading Spring Retry simple example (using builder pattern)

Spring Retry simple example (using xml configuration)

In this post under Spring Retry, I will explain how to configure Spring Retry framework into your application with simple example At minimum, you need the below jars in your classpath1) spring-retry-1.3.1.jar2) commons-logging-1.2.jar3) spring-core-4.3.22.RELEASE.jar4) spring-aop-4.3.22.REELEASE.jar5) spring-beans-4.3.22.RELEASE.jar6) spring-context-4.3.22.RELEASE.jar7) spring-expression-4.3.22.RELEASE.jar8) aspectjweaver-1.8.9.jar If we want to retry a particular failed operation, we can take the help of Spring…… Continue reading Spring Retry simple example (using xml configuration)

Externalizing the logger and handler configuration to properties file

In all my previous posts under java logging, I have configured logger and handler programmatically. We can externalize those configurations to properties file also. The advantage of this approach is that we can change configurations at any time without recompiling java class. In this post I will show with example how to do that. Let’s…… Continue reading Externalizing the logger and handler configuration to properties file