RPC Services vs. Messaging Service

本文介绍了Adobe BlazeDS中两种主要的消息模式:请求/响应模式和发布/订阅模式。通过远程对象、HTTP服务和Web服务组件实现请求/响应模式,支持客户端与服务器之间的异步数据交换。发布/订阅模式则允许一个消息被多个消费者接收,适用于拍卖网站、股票报价服务等场景。文章还提到了使用JMS适配器实现点对点消息传递。

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

 

BlazeDS uses two patterns for sending and receiving messages:

the request/reply pattern and

the publish/subscribe pattern.

 

RemoteObject, HTTPService, and WebService components use the request/reply message pattern, in which the Flex component makes a request and receives a reply to that request.

 

The RPC components are designed for client applications in which a call and response model is a good choice for accessing external data. These components let the client make asynchronous requests to remote services that process the requests, and then return data to your Flex application.

The RPC components call a remote service, and then store response data from the service in an ActionScript or XML object from which you obtain the data. You can use the RPC components in the client application to work with three types of RPC services: remote object services with the RemoteObject component, web services with the WebService component, and HTTP services with the HTTPService component.

 

You declare RemoteObject components in MXML or ActionScript to connect to remote services. Use the RemoteObject component to call methods on a Java class or ColdFusion component.

 

 

Producer and Consumer components use the publish/subscribe message pattern. In this pattern, the Producer publishes a message to a destination defined on the BlazeDS server. All Consumers subscribed to that destination receive the message.

 

The Messaging Service supports publish-subscribe messaging. In publish-subscribe messaging, each message can have multiple consumers. You use this type of messaging when you want more than one consumer to receive the same message. Examples of applications that can use publish-subscribe messaging are auction sites, stock quote services, and other applications that require one message to be sent to many subscribers.

 

You can support point-to-point messaging, also known as queue-based messaging, between Flex clients by using the JMSAdapter and bridging to a JMS queue.

The Messaging Service supports bridging BlazeDS to Java Message Service (JMS) messaging destinations by using the JMSAdapter. The JMSAdapter lets Flex clients publish messages to and consume messages from a JMS server.The JMSAdapter supports topic-based and queue-based messaging.The JMSAdapter class lets Flex applications participate in existing messaging-oriented middleware (MOM) systems. Therefore, a Java application can publish messages to and respond to messages from Flex applications.

JMS queues are point-to-point, unlike topics which are one-to-many.A better choice for point-to-point messaging is to use the ActionScriptAdapter in conjunction with message filtering on the client side.

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值