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

ConnectableObservable autoConnect method

In this post under RxJava, I will explain with example the purpose of autoConnect method in ConnectableObservable class. We can use the autoConnect method to inform in advance how many observers will subscribe to the ConnectableObservable. Once the mentioned number of observers subscribe to the ConnectableObservable, the observable will behave like an cold observable and…… Continue reading ConnectableObservable autoConnect method

Creating Observable from Runnable, Callable, and Action

In this post under RxJava, I will explain with example how to create Observable from Runnable, Callable, and Action interfaces. When creating Observable from Runnable interface, the Observable will execute the code inside Runnable and either throw an error or just completes. When creating Observable from Callable interface, the Observable will execute the code inside…… Continue reading Creating Observable from Runnable, Callable, and Action

Creating a Custom Cold Stateful Observable

In this post under RxJava, I will show with example how to create your own custom cold stateful Observable using “generate” method. The custom cold stateful Observable will hold state information that’s why I said stateful in the previous statement. They are two versions of this method. Below are there syntax 1 -> public static…… Continue reading Creating a Custom Cold Stateful Observable

Parsing an HTML fragment as a body of new html document

In this post under Jsoup, I will explain with example how to parse a html fragment as a body of a new html document. Suppose you have a html fragment as shown below <a href=’wwww.google.com’/> Which you want as body of a new html document as shown below for your reference <html> <head></head> <body> <a…… Continue reading Parsing an HTML fragment as a body of new html document