Posts

Showing posts from July, 2017

Travis CI (Continuous Integration) for GitHub Java-Maven Repository

Image
Travis CI (Continuous Integration) for GitHub Java-Maven Repository Introduction     Travis CI is a hosted, distributed continuous integration service used to build and test software projects hosted at GitHub. In this post I will give an overview of integrating Travis CI with an existing GitHub Java-Maven Project.  Here is how my GitHub Repository looks before Travis CI Integration In this post I will help you to set up Travis CI for your existing GitHub Java-Maven repository in a few simple steps. Step 1: Login to Travis CI Go to  Travis CI Website  and login to it with GitHub credentials. In the next page, allow the default permissions shown. After this, wait for sometime to sync with your GitHub repository.  Click on Accounts link under your username to show all projects in your GitHub Repository. Step 2: Flick Repository Switch ON Flick the Switch ON for the Repository that you would like to integrate to Travis CI Step 3: Add .tra

Asynchronous Processing (@Async) in Spring Boot

Image
Asynchronous   Processing (@Async) in Spring Boot Introduction       I am assuming that you have a Basic Knowledge of Spring Boot and have a Basic Spring Boot Application running in your machine. If not, please check my blog on Basic Spring Boot Application by going to the link:  Spring Boot Tutorial In this tutorial, we will be creating a Spring Boot Application which has the ability to perform Asynchronous Processing Requirements to Run the Application: Java Maven IDE of your choice Once you have a Basic Spring Boot Application, here are the additional steps required to add  the ability to perform Asynchronous Processing. Step 1: Add  @EnableAsync annotation and Add TaskExecutor Bean to Application Class      @EnableAsync annotation turns on Spring’s ability to run @Async methods in a background thread pool. This class customizes the used TaskExecutor. Here I am limiting the number of concurrent threads to 3 and the size of the queue to 600. Here is the code:

Spring Boot Tutorial

Image
Spring Boot Tutorial Introduction     Spring Boot is one of the most popular and most used frameworks for building microservices. Here is a Basic Spring Boot Tutorial with the latest version of Sprint Boot ( 2.0.5.RELEASE ), as of October 2018, which shows you how to build RESTful GET and POST APIs using Spring Boot. What is Spring Boot? From their website:     Takes an opinionated view of building production-ready Spring applications. Spring Boot favors convention over configuration and is designed to get you up and running as quickly as possible.     Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run". We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need very little Spring configuration. Website:  Spring Boot Website Requirements to Run the Application: 1. Java 2. Maven 3. IDE of your choice

Dropwizard Basic Authentication Tutorial

Image
Dropwizard Basic Authentication Tutorial Introduction         I am assuming that you have a Basic Knowledge of Dropwizard and have a Basic Dropwizard Application running in your machine. If not, please check my blog on Basic Dropwizard Application by going to the link:  Dropwizard Tutorial In this tutorial, we will be creating a Dropwizard Application with Basic Authentication (Username and Password Based Authentication) for the RESTful APIs. Requirements to Run the Application: Java Maven IDE of your choice Once you have a Basic Dropwizard Application, here are the additional steps required to add Basic Authentication for the RESTful APIs. Step 1: Dropwizard Auth Module Maven Dependency to be added in pom.xml.  Here is the dependency: <dependency> <groupId>io.dropwizard</groupId> <artifactId>dropwizard-auth</artifactId> <version>${dropwizard.auth.version}</version> </dependency> In this tutorial w

Dropwizard Tutorial

Image
Dropwizard Tutorial Introduction     Today communication between web applications or microservices is achieved using RESTful APIs. The most popular framework to build RESTful APIs in the startup ecosystem is Dropwizard. Dropwizard is also one of the most popular and most used frameworks for building microservices. In this tutorial, we will be creating a Dropwizard Application with GET API, POST API and basic healthcheck code and configuration. Asynchronous processing can also be done in Dropwizard using Java 8 features. I will give an example for Asynchronous processing in a GET API in the code below. . What is Dropwizard? From their website: Dropwizard is a Java framework for developing ops-friendly, high-performance, RESTful web services. Website: Dropwizard Website The following libraries will get added to your classpath once Dropwizard is added in your project: Jetty to embed a HTTP server directly into your project. Jersey for building RESTful web applications.