7.3 使用JMS实现请求/应答程序

本文详细介绍了如何利用JMS实现消息系统中的请求/应答模式,阐述了其核心原理及与传统CS架构的区别,强调了异步处理在可扩展性方面的优势,并举例说明了此类系统在实际应用中的高效性和广泛性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

博客已搬家,更好阅读体验,猛戳 http://www.jack-yin.com/english/translation/activemq-in-action/1558.html

 

7.3 Implementing request/reply with JMS

7.3 使用JMS实现请求/应答程序

 

As described in earlier chapters, messaging is all about the decoupling of senders from

receivers. Messages are sent by one process to a broker, and messages are received from

a broker by a different process in an asynchronous manner. One style of system architecture

that can be implemented using JMS is known as request/reply. From a high level,

a request/reply scenario involves an application that sends a message (the request)

and expects to receive a message in return (the reply). Traditionally, such a system

design was implemented using a client-server architecture, with the server and the client

communicating in a synchronous manner across a network transport (TCP, UDP,

and so on). This style of architecture certainly has scalability limitations, and it’s difficult

to distribute it further. That’s where messaging enters the picture—to provide the

ability to design a system that can easily scale much further via a messaging-based

request/reply design. Some of the most scalable systems in the world are implemented

using asynchronous processing like that being demonstrated in this example.

 

通过前面几章我们了解到,消息是用来为其发送者和接收者解耦的.消息通过一个进程发送给代理,然后

代理在另外一个进程异步的接收消息.一种可以利用JMS来实现的系统架构被称为请求/应答.概括的说,

一个请求/应答场景包括一个发送消息(请求)并期望接收消息返回值(应答)的应用程序.通常,这样的系统

被设计成CS架构,服务端和客户端通过网络传输协议(TCP,UDP等等)同步的进行通信.这种架构方式在可

扩展方面具有明显的限制,很难获得长远发展.消息系统正是为此而生--通过基于消息的请求/应答设计

模式能够设计出易于扩展的系统.正如例子中展示的那样,世界上可扩展性最好的系统都是使通过

异步处理方式实现的.

 

..........

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值