Java系列之消息队列简介

消息队列,也叫消息中间件。消息的传输过程中,消息保存在消息容器中。

消息队列都解决了什么问题?

1、异步

[caption id="attachment_8255" align="aligncenter" width="562"]Java系列之消息队列 Java系列之消息队列:异步[/caption]

2、并行

[caption id="attachment_8256" align="aligncenter" width="600"]Java系列之消息队列 Java系列之消息队列:并行[/caption]

3、解耦

[caption id="attachment_8257" align="aligncenter" width="531"]Java系列之消息队列 Java系列之消息队列:解耦[/caption]

4、排队

[caption id="attachment_8258" align="aligncenter" width="461"]Java系列之消息队列 Java系列之消息队列:排队[/caption]

5 弊端:不确定性和延迟

[caption id="attachment_8259" align="aligncenter" width="520"]Java系列之消息队列 Java系列之消息队列:弊端[/caption]

解决方案:最终一致性,换会时间,提高效率!

消息模式

点对点

Java系列之消息队列

订阅

Java系列之消息队列