How to integrate Jedis with SpringBoot

Add jedis dependency Add dependency in project pom.xml file <!-- Add to jedis rely on --> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> </dependency> Add redis configuration Find the application.properties file in the project resources directory to add reids co ...

Posted on Tue, 31 Mar 2020 20:31:03 -0400 by Bunkermaster

Using Alibaba Druid data source and monitoring sql in SpringBoot

Continue to summarize the work of Java background 2 Preface Previously, I wrote a SSM to replace c3p0 data source with Druid: https://blog.csdn.net/larger5/article/details/79509895 Recently, projects are basically based on SpringBoot. Similarly, using Druid as data source is also a very simple operation and principle Cod ...

Posted on Tue, 31 Mar 2020 07:33:34 -0400 by imranlink

spring boot interceptor

In the process of web development, in order to implement login authorization verification, we often need to add an interceptor to implement login verification when the user's request reaches the controller layer. How can spring boot add an interceptor? The steps are as follows: 1. Inherit the WebMvcConfigureAdapter class, override its addInte ...

Posted on Tue, 31 Mar 2020 05:49:27 -0400 by jasonc

Spring boot tool class static attribute injection and multi environment configuration

Because the MongoDB needs to be accessed, but the local development environment cannot directly connect to MongoDB, the 127.0.0.2 local IP agent needs to be used through SecureCRT. However, after the program is deployed to the online production environment, it can directly access MongoDB. Therefore, after the program is developed, you always ne ...

Posted on Tue, 31 Mar 2020 04:31:59 -0400 by pandu345

spring traditional xml configuration okhttp3

problem The back-end service needs to use http client to request other service support. In the project, HttpClient needs to be replaced with okhttp. Why should okhttp be replaced? The advantages and disadvantages between the two are not discussed here. This article focuses on integrating okhttp with Spring's traditional xml configu ...

Posted on Tue, 31 Mar 2020 02:35:31 -0400 by Joseph Witchard

Spring boot configuration multiple data source read-write separation

1. Modify mybatis.properties #Master data source, default spring.datasource.driver-class-name=com.mysql.jdbc.Driver   spring.datasource.url=jdbc:mysql://127.0.0.1:3306/db   spring.datasource.username=root   spring.datasource.password=123456      #Initialization size, min, Max spring.datasource.initialSize=5   sprin ...

Posted on Tue, 31 Mar 2020 02:03:59 -0400 by ashley526

Return value of controller method in Spring MVC

Original Link: http://www.yiidian.com/springmvc/return-value.html The controller method return value of Spring MVC can support multiple writings, each of which has a different scene and effect.Here's a look at the use of each return value. Normal String Forward String Restring void ModelAndView Java Objects 1 Normal string Returning normal st ...

Posted on Mon, 30 Mar 2020 21:15:39 -0400 by lunac

dubbo source code analysis 1 -- ExtensionLoader.getExtensionLoader

In dubbo source code, extension loader is often used, which uses java SPI mechanism. ProxyFactory proxyFactory = ExtensionLoader. getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); Protocol protocol = ExtensionLoader. getExtensionLoader(Protocol.class).getAdaptiveExtension(); summary 1. Judge whether the clas ...

Posted on Mon, 30 Mar 2020 15:33:47 -0400 by hrichman

Chapter 5 Section 1 spring connect environment

Preface Environment module is the basic module that we seldom use, but it will be used. Just think of the environment as a map, from which you can get the configuration. This festival makes the bird dishes pale and powerless. It's too simple. It's not enough. We need to understand it Source code interpretation Environment public interface En ...

Posted on Mon, 30 Mar 2020 15:31:43 -0400 by thosecars82

Use of springboot~WebTestClient

When using springboot for development, unit testing is necessary. When you build a spring project, it will generate a test project for us. When your project starts, the test cases are carried out at the same time. When we carry out the integration test of the WEB layer, we can use the WebTestClient tool provided by spring for us, which is very ...

Posted on Mon, 30 Mar 2020 14:33:54 -0400 by nkyoung1