Distributed Transaction Management with REST and Try Confirm/Cancel Pattern

Apr 03, 2019

This article introduces how to manage transactions effectively in distributed REST services with Try Confirm/Cancel (TCC) pattern. It also provides a repository that is a simplified Java implementation for anyone who is interested in learning the TCC... Read more

Spring JMS and JPA XA Transactions with WebLogic

Feb 26, 2019

This article shows the configuration of using XA transactions with the resources managed by WebLogic server.... Read more

Recursively Move a Directory

Jan 09, 2019

This article shows one effective implementation that follows the Visitor Pattern to recursively move a directory using Java NIO library.... Read more

Wrap A Command with Builder Pattern

Dec 19, 2018

This article shows a well-designed way to wrap a command and expose it through API with the classic Builder pattern. In this tutorial, you will learn how to write the Builder pattern, and how to direct standard output stream and standard error stream... Read more

Override Enum Methods with Constant Specific Class Body

Nov 20, 2018

This article shows one advanced technique when using enums - constant specific class body.... Read more

Reload Configurations from Spring Cloud Config

Nov 13, 2018

Spring Cloud Config Server automatically retrieves specified configurations backed on Git based Repository. To ask the affected Spring Cloud Config clients to use the updated configuration, a signal needs to be sent to the client. This article shows ... Read more

Overwriting Spring Security Context through Filter

Oct 30, 2018

This article presents a strategy that overwrites the spring security context in order to allow a user to visit the resources without authenticating the user through the authentication filters. ... Read more

Spring Data MongoDB GridFS 3.4

Oct 17, 2018

This article shows a typical usage of MongoDB GridFS with Spring Data MongoDB. This is for MongoDB java driver v3.4 and Spring Data MongoDB v1.10.x. Note that Spring Data MongoDB v2.X introduces breaking changes with the MongoDB java driver 3.6+. Thi... Read more

Handle Non-encoded Request URL

Oct 14, 2018

Normally we need to encode the request URL from the client before sending a request to the server, but there may be just one time that you really can't enforce the client to encode their request URL and sometimes it contains special characters that w... Read more

Entity Graphs for Lazy Loading

Oct 10, 2018

*Entity Graphs* are templates for persistence query. One common problem it solves is *Lazy Loading*. This article introduces the basics of *Entity Graphs* and how to use *Entity Graphs* with *JPA* and *Spring Data* to solve the *Lazy Loading*.... Read more