Introduction In this example we will see how to create or generate separate log file module-wise or for each separate functionality using SiftingAppender in logback with the help of ThreadedContext or MDC in Spring Boot applications. MDC or Mapped Diagnostic Context is a lighter technique consists of uniquely stamping each log request servicing a given…

Posted in Java Spring Boot

How to create separate log file for each module using SiftingAppender and MDC (Mapped Diagnostic Context) in logback

Introduction In this tutorial I will show you how to configure log4j2 in Java, Spring and Spring Boot applications. The same log4j2 configuration will work for Java, Spring and Spring Boot applications. I am not going to show you how to use logback API in Spring Boot application, instead I will exclude logback API from…

Posted in Java Log4J Spring Spring Boot

How to configure log4j2 in Java, Spring and Spring Boot Applications

Introduction In this tutorial I will show you how to work with Apache Kafka Streams for building Real Time Data Processing with STOMP over Websocket using Spring Boot and Angular 8. We will see how to build push notifications using Apache Kafka, Spring Boot and Angular 8. We need to provide some basic things that…

Posted in Angular Kafka Spring Boot WebSocket

Apache Kafka Streams for building Real Time Data Processing with STOMP over WebSocket using Spring Boot and Angular 8

Introduction In this tutorial I will tell you how to create executable jar using gradle or maven build tool in Spring Boot application. Generally maven or gradle tool is used in Java applications to automate the build process. I will also see how to control the target jar name with version appended into it. Spring…

Posted in Gradle Maven Spring Boot

How to create executable jar using Gradle or Maven in Spring Boot Application

Introduction In this example I will show you an example on Spring Boot jQuery AJAX CRUD. CRUD is an acronym for four operations such as Create, Read, Update and Delete. I am going to perform CRUD operations on company details. I will use here MySQL database to store company details information. I will perform each…

Posted in AJAX jQuery Spring Boot Spring JPA

Spring Boot jQuery AJAX CRUD Example

Introduction In this guide we will walk through Spring Boot Data JPA left, right, inner and cross join examples on three tables. In pas we have seen similar example on two tables but I got some requests on how to perform similar joins on three tables. Therefore I am going to show you how to…

Posted in Spring Boot Spring JPA

Spring Boot Data JPA Left, Right, Inner and Cross Join Examples on Three Tables

Introduction We will see an example here how to publish and subscribe message onto MQTT (Mosquitto) using Spring Boot framework. We had seen in our previous example how to publish and subscribe message using Mosquitto client – MQTT.fx. So here we are going to ingrate Spring application with MQTT broker through Spring integration framework, though…

Posted in JMS Mosquitto Spring Boot

Publish Subscribe Message onto MQTT using Spring Boot

Introduction The Spring @ConditionalOnWebApplication and @ConditionalOnNotWebApplication annotations let configuration be included depending on whether the application is a web application. A web application is any application that uses a Spring WebApplicationContext, defines a session scope, or has a StandardServletEnvironment.

Posted in Spring Boot Spring Core

Spring @ConditionalOnWebApplication and @ConditionalOnNotWebApplication Examples

Introduction I will create examples how to work with Spring Conditional on Expression using @ConditionalOnExpression. The @ConditionalOnExpression annotation lets configuration be included based on the result of a SpEL (Spring Expression Language) expression. For this example the Module class is only loaded if a particular SpEL is enabled. This way, you might create similar modules that are only…

Posted in Spring Boot Spring Core

Spring @ConditionalOnExpression Example

Introduction In this tutorial I will create examples on Spring @ConditionalOnResource. The @ConditionalOnResource annotation lets configuration be included only when a specific resource is present in the classpath. For example, the Log4j class is only loaded if the log4j configuration file (log4j.properties) was found on the class-path. This way, you might create similar modules that are only loaded…

Posted in Spring Boot Spring Core

Spring @ConditionalOnResource Example

Introduction Here I will create examples on Spring conditional on property using the annotation @ConditionalOnProperty. The @ConditionalOnProperty annotation allows you to load beans conditionally depending on a certain environment property or configuration of a property. Use the prefix and name attributes to specify the property that should be checked. By default, any property that exists and…

Posted in Spring Boot Spring Core

Spring @ConditionalOnProperty Example

Introduction Spring @ConditionalOnClass and @ConditionalOnMissingClass annotations let @Configuration classes be included based on the presence or absence of specific classes. So @ConditionalOnClass loads a bean only if a certain class is on the classpath and @ConditionalOnMissingClass loads a bean only if a certain class is not on the classpath. This mechanism does not apply the…

Posted in Spring Boot Spring Core

Spring @ConditionalOnClass and @ConditionalOnMissingClass