@Resource Annotation in Spring

@Resource Annotation is used to indicate a reference to a resource, it is considered an alternative to @Autowired which is an Spring standard. Similar to Java EE 5, we can use @Resource Annotation with field injection or setter method.

This tutorial will cover those kinds of injection which will be used for matching by Name, Type or Qualifier.

[Continue reading…] “@Resource Annotation in Spring”

Spring MongoOperations to access MongoDB

MongoDB is an open-source NoSQL document database, written using C++. This tutorial will introduce way to use Spring Boot to access MongoDB and perform CRUD operations with Spring MongoOperations.

Related Articles:
How to build SpringBoot MongoDb RestfulApi
How to use SpringData MongoRepository to interact with MongDB
SpringData MongoDB GridFsTemplate to save, retrieve, delete binary files (Image, Text files)
Angular 4 + Spring Boot + MongoDB CRUD example

[Continue reading…] “Spring MongoOperations to access MongoDB”

Spring ThreadPoolTaskExecutor with Callable interface for concurrency programming

Callable is a Java interface that is an useful methodology for control multi-threading returns on concurrency development.

The tutorial will guide you to build a concurrency program with ThreadPoolTaskExecutor of Spring Framework and Callable interface.

[Continue reading…] “Spring ThreadPoolTaskExecutor with Callable interface for concurrency programming”

Spring Security – Config Security for Web MVC by Spring Boot

Security is an important of a Web Application, So The tutorial will show you way to configure Security for a Web Application with Spring Boot.

Related Articles:
How to use Spring Security JDBC Authentication with PostgreSQL & Spring Boot
Spring Security – Customize Authentication Provider
Spring Security – Customize Login Handler
Spring Security Customize Logout Handler

[Continue reading…] “Spring Security – Config Security for Web MVC by Spring Boot”

Spring Boot with Docker Container

Docker is a new revolution for Linux container and it is a powerful tool for MicroService development.
The tutorial will guild you how to build a Spring Boot application and deploy it with Docker container.

[Continue reading…] “Spring Boot with Docker Container”

Spring Batch Job with Parallel Steps

For scaling a Batch Job, Parallel Steps is one solution that bases on the business logic of application. We split the logic business in distinct responsibilities, and each step can be executed in parallelized flow. The tutorial will guide you how to configure parallel steps with Spring Batch.

Related Articles:
Spring Batch Partition for Scaling & Parallel Processing
How to start with Spring Batch using Spring Boot – Java Config

[Continue reading…] “Spring Batch Job with Parallel Steps”

Spring Profiles – @Profile Annotation and XML Configuration

In application development, sometimes we should make different configuration for each environment. Spring Profiles provides a way to separate application configuration into some parts and they are only available in one or more specific environments.

This tutorial introduces ways to use Spring Profiles by @Profile Annotation or XML Configuration.

[Continue reading…] “Spring Profiles – @Profile Annotation and XML Configuration”

Spring Batch XML Config by Spring Boot

How to start Spring Batch XML Config – use Spring Boot

Many business operations need to process with batch job for critical environment. Spring Batch is a lightweight framework to boot the batch application.

For starting, you can follow the How to start with Spring Batch using Spring Boot – Java Config. In the tutorial I will guide you how to start with XML config.

Related Articles:
How to start with Spring Batch using Spring Boot – Java Config
How to use Intercepting Job Execution in Spring Batch
How to use Spring Batch Restartable Function
Spring Batch – Programmatic Flow Decision
How to import CSV data to PostgreSQL Database using Spring Batch Job

[Continue reading…] “Spring Batch XML Config by Spring Boot”

Inject Properties using @Value Annotations vs Environment vs @ConfigurationProperties

@Value Annotations vs Environment vs @ConfigurationProperties.

Spring provides some ways to inject properties from properties file. We have learned how to use them in 3 articles:
@Value Annotation
Environment
@ConfigurationProperties

This tutorial helps you have a comparison view covering those solutions.

[Continue reading…] “Inject Properties using @Value Annotations vs Environment vs @ConfigurationProperties”

Inject Properties from Properties File using Spring Environment

We can load properties value from Properties file to Spring Environment just by using @PropertySource annotation. This tutorial shows you the simple way to get them from Environment object.

Related Articles:
Inject Properties from Properties File using @Value annotation
Inject Properties from Properties File using @ConfigurationProperties Annotation
How to use Spring Factory Method to create Spring Bean

[Continue reading…] “Inject Properties from Properties File using Spring Environment”

Inject Properties from Properties File using @ConfigurationProperties Annotation

This tutorial will show you the better way to handle properties using @ConfigurationProperties Annotation.

In previous article, we have learned about using @Value annotation to inject properties from properties file. This approach has disadvantage that if we wanna change any property, we have to update all files which referenced it.

[Continue reading…] “Inject Properties from Properties File using @ConfigurationProperties Annotation”

Spring XD Option Module – Batch Job with PostgreSQL Datasource

Spring XD Option Module is an approach to expose metadata of each module for configuration. The tutorial will guide you how to configure PostgreSQL Datasource with Spring XD Annotation: @ModuleOption.

Related articles:
Spring XD Stream – PostgreSQL JDBC Sink
Spring XD Batch Job – How to Start

[Continue reading…] “Spring XD Option Module – Batch Job with PostgreSQL Datasource”

Inject Properties from Properties File using @Value Annotation

This tutorial shows you the way to inject Properties from Properties File using @Value Annotation with Java Configuration and @PropertySource.

You will also know how to use SourcesPlaceHolder and ConversionService for specific cases including: List/Arrays, special types (DateTime, Pattern), when a value that should be treated as null or a placeholder fails to resolve.

[Continue reading…] “Inject Properties from Properties File using @Value Annotation”

Difference between annotation-config and component-scan

annotation-config and component-scan are important basic concepts of Spring Core.
This tutorial helps you understand how to use them and difference between them.

[Continue reading…] “Difference between annotation-config and component-scan”

How to import CSV data to PostgreSQL Database using Spring Batch Job

Spring Batch is a powerful module to implement a batch process for tons of data conveniently.
This tutorial guide you how to import CSV Data to PostgreSQL Database using Spring Batch Job.

Related Articles:
How to start with Spring Batch using Spring Boot
How to use Spring JDBC Template for Postgres Database

[Continue reading…] “How to import CSV data to PostgreSQL Database using Spring Batch Job”

Spring XD Stream – PostgreSQL JDBC Sink

Spring XD JDBC sink can be used to insert message payload data into a relational database table. The tutorial will introduce you how to work with PostgreSQL JDBC Sink

Related Article: Spring XD Stream – How to start with Stream

[Continue reading…] “Spring XD Stream – PostgreSQL JDBC Sink”

Spring XD Stream – How to start with Stream

Spring XD stream is a big data solution for how to ingestion. Each Stream is defined by 3 kinds of module: Source, Sink & Processor.

The tutorial will introduce Spring XD Stream.

Relate Post: Spring XD Batch Job – How to Start

[Continue reading…] “Spring XD Stream – How to start with Stream”

How to use Spring JDBC Template with Spring Boot for Postgres DataBase

The tutorial shows you how to use Spring JDBC Template to access  & manipulate database (Postgres DB) with Spring Boot.

[Continue reading…] “How to use Spring JDBC Template with Spring Boot for Postgres DataBase”

Spring MVC – @RequestMapping with Methods, Headers, Params, @PathVariable and @RequestParam

Creating RESTful web services is more comfortable and simpler when using Spring MVC Annotation.
The tutorial shows you how to use @RequestMapping with Methods, Headers, Params, @PathVariable and @RequestParam.
We will have an example which almost covers all @RequestMapping cases.

[Continue reading…] “Spring MVC – @RequestMapping with Methods, Headers, Params, @PathVariable and @RequestParam”

Spring MVC RESTful Web Service – difference between @Controller and @RestController

Creating RESTful web services is more comfortable and simpler when using Spring MVC Annotation.
The tutorial shows you overview of a traditional Spring MVC Controller and the Spring MVC RESTful Web Service Controller which are implemented in new Spring Framework, and difference between 2 annotations: @Controller and @RestController.

[Continue reading…] “Spring MVC RESTful Web Service – difference between @Controller and @RestController”