Spring boot package separate jar deployment
First of all, a question is raised. Why do we separate the jar package?
The reason is very simple. The jar files that we use the spring boot maven plugin plug-in to package are usually large, or tens of meters less. If the external network transmission of the upload cloud server is slow, why the files will be large after packaging? This is bec ...
Posted by rocram16 on Mon, 06 Jan 2020 04:05:12 -0800
Spring Boot unveiling and actual combat: RabbitMQ
Spring Boot integrates RabbitMQ
Spring Boot is very easy to integrate RabbitMQ. It only needs two steps.
First, add RabbitMQ dependency in pom.xml.
org.springframework.boot
spring-boot-starter-amqp
The second step is to configure the information in src/main/resources/application.properties.
#rabbitmq
spring.rabbitmq.host=local ...
Posted by Jenling on Sun, 05 Jan 2020 03:05:15 -0800
Static concept of Spring MVC
A DispatchServlet: front end controller
II Controller: Controller
Three HandlerAdapter: a class used internally by DispatchServlet
Its relationship with DispatchServlet is shown in the following source code:
public class DispatcherServlet extends FrameworkServlet {
...
private void initHandlerAdapters(Applicatio ...
Posted by nonexistentera on Sun, 05 Jan 2020 00:41:23 -0800
redis key expiration event to realize expiration reminder
redis is turned off by default. It is not recommended to turn it on. This paper provides a reference. Key space notification is usually not enabled because of the additional cost of this process.
1. Enable redis configuration
#
# notify-keyspace-events Ex
#
# By default all notifications are disabled because most users don't need
# th ...
Posted by ravi.kinjarapu on Sat, 04 Jan 2020 20:27:19 -0800
Configuration problems in SSM project
When creating a spring + spring MVC + mybatis project, you first need to configure some corresponding configuration files. Here is a brief introduction of the simplest requirements for these configuration files.
1 Mybatis.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xml ...
Posted by nut legend on Sat, 04 Jan 2020 06:53:37 -0800
Custom use of JpaRepository in Spring boot
Generic JpaRepository class
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface EmployeeRepository extends JpaRepository<Employee,Long>{
}
General filter queries of JpaRepository can be solved in the form of findBy, which is easy to use in general, ...
Posted by Nicholas Reed on Sat, 04 Jan 2020 01:42:54 -0800
Spring boot iterative release JAR slimming configuration
By default, the plug-in spring boot Maven plugin packages the whole project into a Jar package that can run (the so-called Flat Jar), resulting in a large Jar package (usually dozens of M +). Nowadays, there are many things in iterative publishing. It will waste a lot of time to upload such a huge file every time, and sometimes there will be er ...
Posted by Steve Mellor on Fri, 03 Jan 2020 19:59:28 -0800
How can spring automatically assemble bean s?
The autowire parameter of the < bean > node in the spring configuration file can control how beans are automatically assembled
Default - the default is the same as "no"
no - does not auto assemble, requires < ref / > nodes or parameters
byName - assemble by name
byType - assemble by type
Constructor - assemble ac ...
Posted by jagat21 on Fri, 03 Jan 2020 18:08:32 -0800
Analysis of elastic job principle - JobSchedule
Job schedule completes a lot of quartz related content, and also registers the service information to zk, and completes the cache of related job information. In the whole task scheduling, the job schedule completes the elastic job backbone process.
<a name="dI1yS"></a>
JobSchedule
When the elastic job is started, it needs to registe ...
Posted by EchoFool on Fri, 03 Jan 2020 09:56:55 -0800
Spring boot uses spring retry retry mechanism
When we call an interface, we may fail for network reasons and try again successfully. This is the retry mechanism.Be careful to use retries when they are not idempotent.
tips: idempotency
Idempotency is defined in HTTP/1.1 as requesting a resource once or more should have the same result for the resource itself (except for problems such as net ...
Posted by lew14 on Fri, 03 Jan 2020 07:30:07 -0800