Spring Drools Integration Example

Introduction

Drools is a business rule management system with a forward-chaining and backward-chaining inference based rules engine, allowing fast and reliable evaluation of business rules and complex event processing. A rule engine is also a fundamental building block to create an expert system which, in artificial intelligence, is a computer system that emulates the decision-making ability of a human expert.

For more information please read https://www.drools.org/ or https://docs.jboss.org/drools/release/7.6.0.Final/drools-docs/html_single/index.html

Prerequisites

Java version 8 needs to be installed and configured
Gradle plugin needs to be installed into Eclipse
Gradle 4.x needs to installed and configured
Dependencies : Spring boot, drools Continue reading “Spring Drools Integration Example”

Spring SOAP WebService Consumers using Gradle

Please read Spring SOAP WebService Producers using Gradle before continuing this tutorial.

This tutorial will show you how we can consume SOAP based web service using Spring and Gradle. Please get the WSDL file from http://localhost:9999/ws/users.wsdl and you can save the downloaded file under src/main/resources/wsdl directory. This example shows only Spring SOAP web service consumers using Gradle to consume the already deployed or published service.

Prerequisites

Java at least version 8 needs to be installed and configured
Gradle plugin needs to be installed into Eclipse
Gradle 4.x needs to installed and configured
Dependencies : cxf

Continue reading “Spring SOAP WebService Consumers using Gradle”

Spring SOAP WebService Producers using Gradle

This tutorial will show you how we can create and publish SOAP based webservice in Contract-first approach using Spring and Gradle. There are mainly two approaches to create the Webservice – Contract-first & Contract-last. The Contract-first approach tells us to create first XSD/WSDL and then create end-point interface and implementation class. The Contract-last approach tells us to create first end-point interface and implementation class then create WSDL file. This example will show you mainly Spring SOAP Webservice Producers using Gradle, i.e., it will only publish or deploy the web service into the server.

Prerequisites

Java at least version 8 needs to be installed and configured
Gradle plugin needs to be installed into Eclipse
Gradle 4.x needs to installed and configured
Dependencies : Spring boot, wsdl

Continue reading “Spring SOAP WebService Producers using Gradle”

Spring Boot WebSocket AngularJS Gradle Example

Introduction

WebSocket is a very thin, lightweight layer above TCP used to build interactive web applications that send messages back and forth between a browser and the server.

The best examples are live updates websites, where once user access the website neither user nor browser sends request to the server to get the latest updates. Server only keeps sending the messages to the browser.

For more information on WebSocket please read https://en.wikipedia.org/wiki/WebSocket

In this example, I am building a WebSocket application with Spring Boot using STOMP Messaging to provide automatic updates on the greeting message depending on the time of the day for every 3 secs. Continue reading “Spring Boot WebSocket AngularJS Gradle Example”

Spring Boot Liquibase Gradle Example

Introduction

It is often important to consider when developing web application, how to evolve the database schema of a Java web application.

Liquibase is an open source library for tracking, managing and applying database changes that can be used for any database. It helps you create the schema, run them during deployment and also help you write automated tests so that your changes will work in production.

Liquibase is a tool that reads a list of database changes from a changelog file. The changelog file is often XML-based, but it could be in other formats also, such as YAML, JSON and SQL formats. Once a new change is added to the changelog file, Liquibase will read the file, detect the new change, and apply it to the database. When code changes are committed to the version control system, the changelog file containing the database “version” also gets committed along with it.

In this example I will specify the changelog files in XML format, if you want to specify it using YAML and SQL formats then please read here Evolving Database using Spring Boot and Liquibase

For more information http://www.liquibase.org/

Continue reading “Spring Boot Liquibase Gradle Example”