Spring boot2 unit test

Introduce maven dependency powermock is introduced to solve the problem of static method mock. <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> <version>2.0.2</version> <scope>test</scope> </dependency> <dependency> ...

Posted by leeharvey09 on Tue, 15 Oct 2019 03:50:03 -0700

Spring Boot 2.X: Spring Cache

Introduction to Spring Cache Multi-Cache support is introduced in Spring 3.1. In the spring-context package, two interfaces, org.spring framework.cache.Cache and org.spring framework.cache.CacheManager, are defined to unify different caching technologies. Cache interfaces include common operations of caching: add, delete, read, and so on. Cache ...

Posted by copernic67 on Mon, 14 Oct 2019 20:00:28 -0700

Design Patterns-Dynamic Agent Principle and Writing a Dynamic Agent of Our Own by Imitating JDK Proxy

This article contains a lot of code, which may be a bit rough. You can read it selectively. The purpose of this article is to simply analyze the principle of dynamic agent, to imitate JDK Proxy to write a dynamic agent and to summarize several agents. For the introduction and explanation of the agency model, there are many high-quality articles ...

Posted by grga on Mon, 14 Oct 2019 18:13:34 -0700

Spring Cloud Stream for communication between services

Spring Cloud Stream The underlying implementation of Srping cloud Bus is Spring Cloud Stream, which is designed to build a message-driven (or event-driven) micro-service architecture. Spring Cloud Stream itself encapsulates (integrates) and extends modules such as Spring Messaging, Spring Integration, Spring Boot Actuator, Spring Boot Externali ...

Posted by offnordberg on Mon, 14 Oct 2019 13:21:14 -0700

Spring Cloud Gateway, Swagger, Nginx Integration

Groups already configured in the test service configure gateway Adding dependencies to pom<dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> <scope>compile</scope> < ...

Posted by ca87 on Mon, 14 Oct 2019 12:18:57 -0700

Spring Boot + Sharing-JDBC Read-Write Separation

This paper uses Sharding-JDBC to realize read-write separation based on entOS 7 + MySQL 5.7 I. MySQL Installation and Configuration 1.1 installation Execute orders in turn: sudo wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm sudo yum -y install mysql57-community-release-el7-10.noarch.rpm sudo yum ...

Posted by dagee on Mon, 14 Oct 2019 08:53:24 -0700

[Spring cloud realizes advertising system step by step] 3. Gateway routing

Zuul(Router and Filter) WIKI: Portal Effect Authentication/Security Insights Stress Testing Canary Testing Dynamic Routing Service Migration Load Shedding Static Response handling Active/Active traffic management Key configurations: The configuration property zuul.host.maxTotalConnections and zuul.host.maxPerRouteConnections, which default ...

Posted by DedMousie on Mon, 14 Oct 2019 08:16:55 -0700

Spring's Learning _ 2.IoC Control Inversion

1.Ioc (inversion of control) controls inversion (an idea). IoC is an idea. Before that, the creation of objects used in programs must be completed by programmers. IoC entrusts the creation, preservation and management of objects (life cycle) to Spring, so Spring is also equivalent to a container (object of objects stored), which is the process ...

Posted by hammerslane on Mon, 14 Oct 2019 07:33:59 -0700

Handler Exception Resolver for Custom Exception Handling in the SpringBook series of tutorials

About the global exception handling of Web applications, the last article introduced the way of Controller Advice combined with @ExceptionHandler to realize the global exception management of Web applications. This blog post brings another unusual way to handle exceptional states by implementing a custom Handler Exception Resolver Links to the ...

Posted by Guffi on Mon, 14 Oct 2019 04:59:41 -0700

Zero-intrusive distributed link log minbox-logging uses document v1.0

MinBox Logging MinBox Logging is a distributed, zero-intrusion link log analysis framework, which supports configuration and use under Spring Cloud micro-service architecture. It encapsulates RestTemplate and OpenFeign to transmit link information. Zero invasive MinBox Logging does not need to use annotation configuration to collect link logs, ...

Posted by Syntax on Sun, 13 Oct 2019 20:59:20 -0700