Volantis
文档
帮助
示例
社区
博客
源码
中文文档官方文档中文文档社区嘿嘿
微服务强调服务的大小,他关注某一个点,一个模块只做一种事情微服务架构通常而言,他提倡将单一的程序划分为一组小的服务,每个服务运行在独立的进程中,采用轻量级的通信机制 doubbo是rpc,springcloud是restful
@Configuration 指定这个是配置类@ConditionalOnxxx 在某些条件下才生效@AutoConfigureAfter 指定自动配置类的顺序@Bean 给IOC加组件@ConfiguretionProperties 结合相关的xxxProperties配置类来绑定配置@EnableConfigurationProperties 让xxxProperties生效加入到容器中讲自动配置类配置在META-INF/spring.factories中
几个重要的事件回调机制
1
return new SpringApplication(primarySources).run(args);
现在左边的参数是null
123456789101112
public SpringApplication(Class<?>... primarySources) { this(null, primarySources);}public SpringApplication(ResourceLoader resourceLoader, Class<?>... primarySources) { this.resourceLoader = resourceLoader; Assert.notNull(primarySources, "PrimarySources must not be null"); this.primarySources = new LinkedHashSet<>(Arrays.asList(primarySources)); this.webApplicationType = WebApplicationType.deduceFromClasspath(); setInitializers((Collection) getSpringFactoriesInstances(ApplicationContextInitializer.class)); setListeners((Collection) getSpringFactoriesInstances(ApplicationListener.class)); this.mainApplicationClass = deduceMainApplicationClass();}
选择MySQL+JDBC+Web
123456
spring: datasource: username: root password: 123456 url: jdbc:mysql://localhost:3306/jdbc driver-class-name: com.mysql.jdbc.Driver
3 / 9