Tag : Spring

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

Spring Default Non-nested Calls The Spring Framework’s transaction infrastructure code will only identify transaction rollbacks by default when runtime and unchecked exceptions are thrown. That is, when an instance of a RuntimeException or its subclass is thrown. (Errors, too-by default-identifies transaction rollback. ) Checked exceptions thrown from the transaction method will not be identified for ..

Read more

ApplicationReadyEvent This event indicates that application should be initialized and ready to receive the request. Event published as late as conceivably possible to indicate that the application is ready to service requests. The source of the event is the SpringApp lication itself, but beware of modifying its internal state since all initialization steps will have ..

Read more

Order This article mainly talks about the differences between permitAll and webIgnore of spring security. PermitAll configuration instance @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override public void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers(“/css/**”, “/js/**”,”/fonts/**”).permitAll() .anyRequest().authenticated(); } } Web ignore configuration instance @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override public void configure(WebSecurity ..

Read more