总结
这个月马上就又要过去了,还在找工作的小伙伴要做好准备了,小编整理了大厂java程序员面试涉及到的绝大部分面试题及答案,希望能帮助到大家
image
- LogServiceImpl 切换数据源,记录log表
image
- LogServiceImpl 切换数据源,记录log表
image
- AOP标准日志格式
image
- springboot项目中是否使用过EnableCaching
image
下面咱们按照springboot的方式 编写EnableLogging
- @Import(LogImportSelector.class)
image
- LogImportSelector
image
- 使用EnableLogging
image
总结
1.@Import用来导入一个或多个类(会被spring容器托管),或者配置类(配置类里面的bean都会被spring容器托管)
2. ImportSelector 该接口的方法的返回值都会被纳入到spring容器管理中
@Import
image
-
import可以采用importselecor的返回值加入到spring容器
-
import还可以自定义ImportBeanDefinitionRegistrar接口,通过BeanDefinitionRegistry纳入到spring容器
链路跟踪
spring-cloud-sleuth-core
image
网关传递traceid
image
方法拦截器设置traceid
image
aop处理traceid
image
traceid处理
image
feign处理traceid
image
RestTemplate处理traceid
image
api-gateway
image
auth-server
image
grep -rn
image
HP@owen /cygdrive/d/open-capacity-platform
$ grep -rn a26003208271fd94 *
logs/auth-gateway/auth-gateway-info.log:740:[auth-gateway:130.75.131.208:9200] [a26003208271fd94] [a26003208271fd94] 2019-09-06 09:38:33.898 INFO 6364 [XNIO-2 task-3] com.open.capacity.client.filter.ResponseFilter request url = http://127.0.0.1:9200/api-auth/validata/code/1263967C-FED7-4732-86D7-8CC6BDF752F5, traceId = a26003208271fd94
logs/auth-gateway/auth-gateway-info.log:741:[auth-gateway:130.75.131.208:9200] [a26003208271fd94] [a26003208271fd94] 2019-09-06 09:38:36.703 INFO 6364 [XNIO-2 task-3] com.open.capacity.client.filter.ResponseFilter response url http://127.0.0.1:9200/api-auth/validata/code/1263967C-FED7-4732-86D7-8CC6BDF752F5, traceId = a26003208271fd94
oauth-center/logs/auth-server/auth-server-info.log:722:[auth-server:130.75.131.208:8000] [a26003208271fd94] [b26ed6e6877dd47a] 2019-09-06 09:38:34.795 INFO 15168 [http-nio-8000-exec-1] com.open.capacity.log.aop.LogAnnotationAOP 开始请求,transid=a26003208271fd94, url=com.open.capacity.uaa.server.controller.ValidateCodeController/createCode , httpMethod=null, reqData=[“1263967C-FED7-4732-86D7-8CC6BDF752F5”]
oauth-center/logs/auth-server/auth-server-info.log:723:[auth-server:130.75.131.208:8000] [a26003208271fd94] [b26ed6e6877dd47a] 2019-09-06 09:38:36.671 INFO 15168 [http-nio-8000-exec-1] com.open.capacity.log.aop.LogAnnotationAOP 请求完成, transid=a26003208271fd94, 耗时=1898, resp=null:
image
CompletableFuture.runAsync 与链路跟踪
image
[test-log-center:130.75.131.208:8080] [,d1d8bf482db0af10] 2019-09-16 13:40:25.181 INFO 18088 [http-nio-8080-exec-10] com.open.capacity.log.test.controller.TestController ok
[test-log-center:130.75.131.208:8080] [,d1d8bf482db0af10] 2019-09-16 13:40:25.220 INFO 18088 [pool-1-thread-1] com.open.capacity.log.test.controller.TestController oook
- 异步传递MDC
写在最后
作为一名即将求职的程序员,面对一个可能跟近些年非常不同的 2019 年,你的就业机会和风口会出现在哪里?在这种新环境下,工作应该选择大厂还是小公司?已有几年工作经验的老兵,又应该如何保持和提升自身竞争力,转被动为主动?
就目前大环境来看,跳槽成功的难度比往年高很多。一个明显的感受:今年的面试,无论一面还是二面,都很考验Java程序员的技术功底。
最近我整理了一份复习用的面试题及面试高频的考点题及技术点梳理成一份“Java经典面试问题(含答案解析).pdf和一份网上搜集的“Java程序员面试笔试真题库.pdf”(实际上比预期多花了不少精力),包含分布式架构、高可扩展、高性能、高并发、Jvm性能调优、Spring,MyBatis,Nginx源码分析,Redis,ActiveMQ、Mycat、Netty、Kafka、Mysql、Zookeeper、Tomcat、Docker、Dubbo、Nginx等多个知识点高级进阶干货!
由于篇幅有限,为了方便大家观看,这里以图片的形式给大家展示部分的目录和答案截图!
Java经典面试问题(含答案解析)
阿里巴巴技术笔试心得
Java经典面试问题(含答案解析)
[外链图片转存中…(img-yhh2nfwl-1715460584133)]
阿里巴巴技术笔试心得
[外链图片转存中…(img-JcjeZ1cK-1715460584134)]