Tag : Spring

1. Add dependencies. In addition to the packages required by SSM, the packages to be added are mybatis-ehcache.jar, ehcache-spring-annotations.jar; Maven coordinates are as follows: <!–Mybatis-ehcache–> <dependency> <groupId>org.mybatis.caches</groupId> <artifactId>mybatis-ehcache</artifactId> <version>1.0.3</version> </dependency> <!–ehcache-spring-annotations–> <dependency> <groupId>com.googlecode.ehcache-spring-annotations</groupId> <artifactId>ehcache-spring-annotations</artifactId> <version>1.2.0</version> </dependency> 2.echache profile, as follows: ehcache.xml <?xml version=”1.0″ encoding=”UTF-8″?> <ehcache xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”http://ehcache.org/ehcache.xsd”> <diskStore path=”java.io.tmpdir”/> <defaultCache maxElementsInMemory=”3000″ eternal=”false” timeToIdleSeconds=”3600″ timeToLiveSeconds=”3600″ overflowToDisk=”true” ..

Read more

Problem Business scenario There are often some edge operations on business requirements, such as main process operation A: users sign up for courses for warehousing, and edge operation B: sending emails or short message notifications. Business requirements After operation A fails to operate the database and the transaction rolls back, operation B cannot be executed. ..

Read more

Order Traditional spring is generally configured based on xml, but many comments of JavaConfig were added later. Springboot, in particular, is basically all java config. if you don’t understand it, you really don’t adapt. Note here. @RestController Spring4 has added RestController’s comments in order to more conveniently support the development of restfull applications. More functions ..

Read more

SpringBoot configuration property series MVC for SpringBoot configuration attributes Server for SpringBoot configuration properties DataSource for SpringBoot configuration properties SpringBoot configuration property NOSQL MQ for SpringBoot configuration properties Security for SpringBoot configuration properties Migration of SpringBoot configuration properties SpringBoot configuration properties other In addition, I attach some personal articles about springboot. SpringBoot past lives SpringBoot ..

Read more

SpringBoot configuration property series MVC for SpringBoot configuration attributes Server for SpringBoot configuration properties DataSource for SpringBoot configuration properties SpringBoot configuration property NOSQL MQ for SpringBoot configuration properties Security for SpringBoot configuration properties Migration of SpringBoot configuration properties SpringBoot configuration properties other In addition, I attach some personal articles about springboot. SpringBoot past lives SpringBoot ..

Read more

SpringBoot configuration property series MVC for SpringBoot configuration attributes Server for SpringBoot configuration properties DataSource for SpringBoot configuration properties SpringBoot configuration property NOSQL MQ for SpringBoot configuration properties Security for SpringBoot configuration properties Migration of SpringBoot configuration properties SpringBoot configuration properties other In addition, I attach some personal articles about springboot. SpringBoot past lives SpringBoot ..

Read more

Order SpringBoot’s starter is mainly used to simplify dependencies. This article is mainly divided into two parts, one is to list some starter’s dependencies, the other is to teach you to write a starter yourself. Part of starters’ Dependence Starter(Group ID: org.springframework.boot) Delivery depends on spring-boot-starter-log4j2 ■ org.apache.logging.log4j:log4j-slf4j-impl■ org.apache.logging.log4j:log4j-api■ org.apache.logging.log4j:log4j-core■ org.slf4j:jcl-over-slf4j■ org.slf4j:jul-to-slf4j spring-boot-starter-logging ■ ch.qos.logback:logback-classic■ ..

Read more

Order When using netty to develop rpc, one of the problems facing the client side is how the client can easily call remote services. Rmi in java gives a good example through proxy mode. Through proxy, calling remote service is as simple as calling local service for users. For published services, interfaces using java are ..

Read more

@Profile This annotation can be used in conjunction with @Configuration to specify the configuration of different profile using java code. It can be annotated on classes or methods of @ beans. Comments on Class dev @Configuration @Profile(“dev”) public class CacheConfigDev { private static final Logger log = LoggerFactory.getLogger(CacheConfigDev.class); @Bean public CacheManager concurrentMapCacheManager() { log.debug(“Cache manager ..

Read more