Cache List and write file persistence

LIfe is half spent before we know what is it.   Cache List and write file persistence You need to cache a List set, such as the contents of an input box that the user has previously entered. The next time the user wants to write in the input box, he will call the cached interface to take out and return the previously entered items from the c ...

Posted on Tue, 12 Nov 2019 13:38:51 -0800 by jkatcherny

Spring boot's correct posture for logging

Previous articles Spring Boot log processing are you still using Logback? Brief introduction The previous article focuses on the configuration of Log4j2, and this article focuses on the application of unified log processing. The following includes HTTP request log processing and Exception exception log processing. HTTP request log img 1. Clear ...

Posted on Sat, 09 Nov 2019 06:01:50 -0800 by burhankhan

Data paging and sorting using Spring Data JPA

I. reading guidance If thousands of list data are loaded at one time, it will be very time-consuming to display on the web page, and the user experience is not good. Therefore, paging query is essential when dealing with the display of large data query results. Paging query must be accompanied by certain sorting rules, otherwise the status of ...

Posted on Wed, 06 Nov 2019 16:45:13 -0800 by gtcol

ThreadLocal small test ox knife

The data saved in ThreadLocal can only be private to the current thread and not visible to other threads Prove Declare a global variable threadLocal with the initial value of 1. Access and modify the settings through three threads. In theory, the final value of threadLocal should be 6. However, our output result is 3, which shows that the dat ...

Posted on Sat, 02 Nov 2019 22:36:19 -0700 by jamiller

Spring Cloud gateway service zuul II

One thing I forgot to mention in the last article is that nacos has the highest load priority. Service startup takes priority to pull configuration information. So I didn't talk about the configuration file created in nacos center in the last service building You can see that both the service port and the registry are configured in the configu ...

Posted on Wed, 30 Oct 2019 18:10:20 -0700 by no3dfx

Spring Cloud Alibaba uses nacos registry

background In the last article, we talked about how to build a registry. This time, we talked about how to use nacos as a registry. Spring cloud Alibaba basis to create basic dependency First of all, we create a spring cloud Alibaba basis basic dependency project to work out the common version we want to use. spring boot version 2.1.7.RELEASE ...

Posted on Sun, 27 Oct 2019 17:58:59 -0700 by banks1850

Vi. MapReduce sorting example - get the highest price commodity information

1, demand Get the most expensive item in each order Knowledge points used:Custom sort, including general sort, secondary sort and group sortCustom partition 2. Data input and output format Data input format: One record per sold item Order id commodity id commodity price 0000001 Pdt_01 222.8 0000002 Pdt_06 722.4 0000001 Pdt_05 25.8 0000003 ...

Posted on Thu, 24 Oct 2019 14:15:47 -0700 by skalooky

The implementation of dynamic data source read-write separation of baomidou and the addition of AOP to select the library according to the method name

File https://gitee.com/baomidou/dynamic-datasource-spring-boot-starter/wikis/pages maven <dependency> <groupId>com.baomidou</groupId> <artifactId>dynamic-datasource-spring-boot-starter</artifactId> <version>2.5.7</version> </dependency> Pure read-write separation (myba ...

Posted on Tue, 22 Oct 2019 08:02:08 -0700 by Teaky

Java 8 Optional: avoid NPE gracefully

This article details the Optional class and how to use it to eliminate null checking in your code. Before we start, let's look at what NPE is and how to deal with it before Java 8. NullPointException (NPE for short) can be said to be an exception that all Java programmers have encountered. Although Java has tried to let programmers get rid of p ...

Posted on Tue, 22 Oct 2019 04:52:26 -0700 by jarosciak

Universal rule matching algorithm (original) (java+.net)

1. Spring Spel l or Google Aviator can be used in Java If you use Aviator, add the following dependencies <dependency> <groupId>com.googlecode.aviator</groupId> <artifactId>aviator</artifactId> <version>4.1.2</version> </dependency>   However, ...

Posted on Mon, 14 Oct 2019 11:28:43 -0700 by kjtocool