File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1+ ## 消息队列
2+ 消息队列是为了解决** 生产和消费的速度不一致** 导致的问题,有以下好处:
3+ 1 . 减少请求响应时间。比如注册功能需要调用第三方接口来发短信,如果等待第三方响应可能会需要很多时间
4+ 2 . 服务之间解耦。主服务只关心核心的流程,其他不重要的、耗费时间流程是否如何处理完成不需要知道,只通知即可
5+ 3 . 流量削锋。对于不需要实时处理的请求来说,当并发量特别大的时候,可以先在消息队列中作缓存,然后陆续发送给对应的服务去处理
6+
7+ 如果想要实现一个消息队列,可以参考[ 这里] ( https://zhuanlan.zhihu.com/p/21649950 )
8+ 最简单的消息队列就是一个消息转发器,基本功能只有三个:消息存储、消息发送、消息删除,可使用LinkedBlockingQueue、ConcurrentLinkedQueue实现
9+
10+ 对于消息队列另外一个通俗易懂的[ 解释] ( https://www.zhihu.com/question/34243607 )
Original file line number Diff line number Diff line change @@ -22,9 +22,12 @@ PS:除开知识点,一定要准备好以下内容:
2222### [ TCP] ( https://github.com/xbox1994/2018-Java-Interview/blob/master/MD/TCP.md )
2323### [ 数据结构] ( https://github.com/xbox1994/2018-Java-Interview/blob/master/MD/数据结构.md )
2424### [ 高性能] ( https://github.com/xbox1994/2018-Java-Interview/blob/master/MD/高性能.md )
25- ### 分布式(正在完善)
26- * [ 缓存] ( https://github.com/xbox1994/2018-Java-Interview/blob/master/MD/分布式-缓存.md )
25+ ### 分布式
26+ * [ CAP理论] ( https://www.zhihu.com/question/54105974 )
27+ * [ 缓存] ( https://www.zhihu.com/question/21419897 )
2728* [ 锁] ( https://blog.csdn.net/xlgen157387/article/details/79036337 )
29+ * [ 事务] ( https://www.cnblogs.com/xybaby/p/7465816.html )
30+ * [ 消息队列] ( https://github.com/xbox1994/2018-Java-Interview/blob/master/MD/分布式-消息队列.md )
2831### [ 搜索引擎] ( https://github.com/xbox1994/2018-Java-Interview/blob/master/MD/搜索引擎.md )
2932搜索引擎是因为个人项目关系,那个搜索引擎非常简单,但有很多东西可以问到,可选择性学习借鉴,了解到对项目是如何提问的,还有问题的深度
3033### [ 在线编程] ( https://github.com/xbox1994/2018-Java-Interview/blob/master/MD/在线编程.md )
You can’t perform that action at this time.
0 commit comments