Building Mule Apps with Gradle in Eclipse

Building Mule Apps with Gradle in Eclipse, i.e., you are going to create Mule project outside Mule Studio. We will build the Mule project in Eclipse using Gradle script. Gradle is becoming more and more popularity as a build system. It combines the power of scripting with the simplicity of conventions, where customization does not end up in tons of messy configurations. Over the times we have done building Mule apps through Mule Studio using Maven plugin. Here you will create build.gradle script with your own hand to build the Mule project in Eclipse.

Continue reading “Building Mule Apps with Gradle in Eclipse”

Integrate npm web app in Spring Boot with Gradle

Integrate npm web app in spring boot with gradle is basically a multi-module project as we have seen in our earlier tutorials here with maven build in spring boot and here with maven in Eclipse. But the example on integrate npm web app in spring boot with gradle uses gradle to build the project. Here we basically create two modules one is frontend or client side called web-app and another one is backend called java-app. Obviously as the name suggests web-app, so it will contain only client side technologies to build the application whereas java-app will contain only java technologies to build the application. You don’t need to install npm going to the web-app folder manually. Npm installation and build will be automatically taken care by gradle build script. This application will also create an executable jar file once gradle build is successfully finished.

Continue reading “Integrate npm web app in Spring Boot with Gradle”

Spring Boot MVC AutoComplete using jQuery

Introduction

Autocomplete allows you to easily create autocomplete and auto-suggest boxes for text input fields. When you start a search on Google, you can find the information you are looking for using search predictions. Search predictions are possible search terms you can use that are related to the terms you are typing and what other people are searching for. Spring Boot MVC autocomplete example will show you exactly the same thing here.

Autocomplete is a feature in which an application predicts the rest of a word a user is typing. In graphical user interfaces, users can typically press the tab key to accept a suggestion or the down arrow key to accept one of several.
Autocomplete speeds up human-computer interactions when it correctly predicts the word a user intends to enter after only a few characters have been typed into a text input field. The autocomplete is a normal text input enhanced by a panel of suggested options. Continue reading “Spring Boot MVC AutoComplete using jQuery”

Server Sent Events with Spring – Push Notifications

Introduction

We have seen a popular choice for sending real time data from server to client in web application is using WebSocket in our previous tutorials Messaging with STOMP over WebSockets using Spring and ActiveMQ and Spring Boot WebSocket AngularJS Gradle Example. WebSocket opens bidirectional connections between server and client. So both server and client can send messages. But sometimes we face situations, where the application needs only one way communication, i.e., sending data from server to the client and for this Spring provides a simpler solution using Server Sent Events (SSE). SSE is a technology that allows you to stream data from server to the browser  (Push Notifications) within one HTTP connection in one direction. For example, pushing stock price changes in real-time or showing progress of long-running process or real time showing of cricket or football scores on display board etc.

Browser Support

SSE are supported in most modern browsers. Only Microsoft’s IE and Edge browsers do not have a built in implementation. But there is a way out because Server-Sent Events uses common HTTP connections and can therefore be implemented with the following libraries to support IE and Edge browsers.

Continue reading “Server Sent Events with Spring – Push Notifications”

Evolving Database using Spring Boot and Liquibase

When developing web application, it is important to consider how to create schema for production and evolve the database schema going forward 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. Continue reading “Evolving Database using Spring Boot and Liquibase”

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”

Generating jaxb classes from xsd using Gradle

This tutorial will show you how to generate Jaxb classes from Xsd file using Gradle. Generating jaxb classes from xsd using Gradle is not an easy task because Gradle does not have yet any ready-made plugin like Maven. So to generate java classes from xsd schema using Gradle we have to write an an Ant Task. The below example will show you how to do it.

Prerequisites

Eclipse

JDK 8 or 9

Have Gradle installed and configured

Required dependencies in Gradle’s build file

Now follow the below steps in order to complete the example.

Create Gradle project GradleXsdToJaxb in Eclipse Continue reading “Generating jaxb classes from xsd using Gradle”

Analyze Code Quality of Java Application using SonarQube

This tutorial will show you how to analyze code quality of Java applications using SonarQube. Maintaining the quality of code is an important part of the application and it is required to find out any bugs, issues in the developed code so that we can remove any kind of vulnerabilities from the application before moving to the production.

Continue reading “Analyze Code Quality of Java Application using SonarQube”