Posts

Spring boot Drools Integration

Image
Introduction Introduction Decision tables are a "precise yet compact" way of representing conditional logic, and are well suited to business level rules. Refer Official documentation on drools decision tables and other supported formats. Tip Drools supports managing rules in a spreadsheet format. Supported formats are Excel (XLS), and CSV. Core Components in Drools Java API The KnowledgeBuilder is responsible for taking source files, such as a DRL file or an Excel file, and turning them into a Knowledge Package of rule and process definitions which a Knowledge Base can consume. An object of the class ResourceType indicates the type of resource it is being asked to build. The ResourceFactory provides capabilities to load resources from a number of sources, such as Reader, ClassPath, URL, File, or ByteArray. Caution Binaries, such as decision tables (Excel .xls files), should not use a Reader based resource handler, whic...

Spring boot RxJava Integration

What is RxJava What is RxJava RxJava is a Java implementation of ReactiveX library for composing asynchronous and event-based programs by using observable sequences. The building blocks of RxJava are Observables and Subscribers . Observable is used for emitting items and Subscriber is used for consuming those items. How it works RxJava works like this. Subscriber subscribes to Observable, then Observable calls Subscriber.onNext() for any number of items, if something goes wrong here is Subsciber.onError() and if all finishes fine, here is Subscriber.onCompleted() . Read more about RxJava at their official documentation Types of Observables and Observers The following are the different types of Observables in RxJava: Single Observable Flowable Maybe Completable For each Observable there is one Observer Following are the different types of Observers in RxJava: Observer SingleObserver MaybeObserver ...

Gradle plugin development

Image
Writing Custom Plugin Gradle is an open-source build automation system that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML. Demonstrating gradle plugin development to generate customized sourceSet. — ThirupathiReddy Vajjala Writing Custom Plugin Gradle makes it very easy to build custom binary plugins. You simply need to create a class that implements the org.gradle.api.Plugin<T> interface. The plugin class and its code can be reside in one of the following three locations: Build script : Can be directly embedded into the build script. This approach limits the reuse value of the plugin buildSrc project : can reside under the buildSrc project is automatically compiled and is made available in the build scripts classpath. Stand-alone project : can be bundled as a JAR file that can then be included in the build script’s classpath. ...