RabbitMQ pull mode mass consumption message
Consumers who implement RabbitMQ have two modes: Push and Pull.The recommended way to implement push mode is to inherit DefaultConsumer base class, or use Spring AMQP's SimpleMessageListenerContainer.Push mode is the most commonly used, but it is not applicable in some cases, such as:Due to certain restrictions, consumers can only consume mess ...
Added by dinosoup on Mon, 09 Dec 2019 07:25:57 +0200
Elegant configuration of interceptors in Spring Boot
In fact, the configuration mode of spring boot interceptor is similar to that of spring MVC. Only a few small changes need to be noticed. Here are two kinds of commonly used interceptors:
I. Interceptor Based on URL:
public class LoginInterceptor extends HandlerInterceptorAdapter{
/**
* Call before request processing (before Controll ...
Added by garry on Mon, 09 Dec 2019 01:59:42 +0200
How is JavaScript implemented in AOP?
The concept of AOP should be familiar to anyone who has used spring. In Dojo, AOP is also supported. I don't know if there is AOP support for other JavaScript frameworks and libraries. AOP is also called face-to-face programming. Students who have used spring must be very familiar with AOP. In js, AOP is a technology point that has been seriou ...
Added by steveangelis on Mon, 09 Dec 2019 01:12:40 +0200
spring default boot location and contextConfigLocation settings for source resolution
Looking at the spring source these days, which covers where spring starts, let's see where spring actually started loading.This article uses spring3.0M3
The first spring load will go directly to the web.xml file with the help of a listener, ContextLoaderListener
<listener>
<listener-class>org.springframework.web.conte ...
Added by qazwsx on Sun, 08 Dec 2019 19:51:54 +0200
java backend solves cross domain problems through Filter filter
This scheme only needs the code modification of the server
Because now we want to separate the front end and the back end, there must be cross domain problems. Here are the effective codes we have tested:
Steps:
I. add in the web.xml file
<!-- 2019-01-15 Solve cross domain problems -->
<filter>
<filter-name>cros ...
Added by aseaofflames on Sun, 08 Dec 2019 18:52:48 +0200
springboot series four profile s multi environment configuration
Some configuration parameters during development and after going online are not available, such as database connection, SMS verification, etc
springboot provides us with a way to differentiate environment configuration
Different environment configurations for the same profile
Three bars can be used in the same configuration file application.yml ...
Added by Assorro on Sun, 08 Dec 2019 11:10:02 +0200
Spring cloud configuration client
Override remote configuration properties
By default, Spring Cloud is allowed to be overridden, spring.cloud.config.allowOverride=trueAdjust the value to "false" through the program start parameter
--spring.cloud.config.allowOverride=true
After startup, Postman sends POST request again, and adjusts the value of spring.application.name ...
Added by tolli on Sat, 07 Dec 2019 21:05:55 +0200
Spring boot: let me show you the principle of automatic assembly
Preface
Spring is translated into Chinese as "spring". Indeed, in a certain period of time, it has brought spring to Java developers. However, with the expansion of our project scale, there are more and more places where spring needs to be configured. To exaggerate, "configuration takes two hours, Coding takes five minutes". ...
Added by rawisjp on Sat, 07 Dec 2019 08:32:54 +0200
Project start spring is inexplicably null, null pointer is abnormal, troubleshooting
Before the project, it ran well. As a result, after other related modules updated the code, the project startup reported an error
2019-12-06 08:55:13 [main] ERROR o.s.boot.SpringApplication - Application startup failed
java.lang.NullPointerException: null
at org.springframework.beans.factory.support.DefaultListableBeanFactory$FactoryAwareOr ...
Added by andymike07 on Sat, 07 Dec 2019 00:40:16 +0200
Prototype mode, strategy mode and observer mode of design mode
I. prototype mode
1. What is prototype mode
Clone
The prototype pattern is a creation pattern. The word "prototype" indicates that there should be a template instance for the schema change. Users copy an object with consistent internal properties from the template object. This process is also called "cloning". The copied ins ...
Added by iyia12co on Fri, 06 Dec 2019 15:03:32 +0200