【转】Difference between Point-To-Point and Publish/Subscribe JMS Messaging Models
Difference between Point-To-Point and Publish/Subscribe JMS Messaging Models
Point-to-Point (PTP) and Publish/Subscribe (Pub/Sub) are two types of messaging models or messaging domains provided by JMS. Both of these have significant differences and should be used as per the application’s requirement. For instance, point-to-point messaging should be used when each message delivered by a producer should be consumed successfully by one receiver andpublish/subscribe messaging should be used when each message delivered by a producer should be consumed by zero or more receivers.
Here is a more detailed difference between the two messaging models:
|
Point-to-Point (Queue) |
Publish-Subscribe (Topic) |
1. | Each message is addressed to a virtual channel known as Queue | Each message is addressed to a virtual channel know as Topic |
2. | One-to-One i.e. a message delivered by a producer is consumed by only one receiver | One-to-Many i.e. a message delivered by a producer (publisher) can be consumed by zero or more receivers (subscribers) |
3. | A queue can have multiple receivers, but each message is consumed by only one receiver | A topic can have multiple receivers and every receiver receives a copy of each message |
4. | Pull-based model i.e. client polls the queue for new messages and sends the request | Push-based model i.e. messages are broadcasted to all the subscribers without them having to poll the topic |
5. | Messages are retained in the queue until they are delivered to the receiver. The receiver can fetch the message even if it was not running when producer sent the messages. | Messages are retained in the topic until they are delivered to the “current“ subscribers.There is an option to have durable subscriptions in pub-sub model which allows the subscriber to dis-connect, reconnect again and collect the messages that were delivered when it was not active. |
6. | The receiver acknowledges the successful processing of a message. | Acknowledgment is optional. |
Thus whether to use queue or topic as JMS message destination, depends solely on the requirements of a specific application.
转自: http://verticalhorizons.in/difference-between-point-to-point-and-publishsubscribe-jms-messaging-models/
【转】Difference between Point-To-Point and Publish/Subscribe JMS Messaging Models的更多相关文章
- 使用Guava EventBus构建publish/subscribe系统
Google的Guava类库提供了EventBus,用于提供一套组件内publish/subscribe的解决方案.事件总线EventBus,用于管理事件的注册和分发.在系统中,Subscribers ...
- 【RabbitMQ】Publish/Subscribe
Publish/Subscribe 在上一节我们创建了一个work queue.背后的设想为每个任务被分发给明确的消费者.这节内容我们将做一些完全不同的事情 -- 我们将发送一条消息给多个消费者.这种 ...
- publish/subscribe
Pub/Sub功能 Pub/Sub功能(means Publish, Subscribe)即发布及订阅功能.基于事件的系统中,Pub/Sub是目前广泛使用的通信模型,它采用事件作为基本的通信机制,提供 ...
- Mina、Netty、Twisted一起学(七):发布/订阅(Publish/Subscribe)
消息传递有很多种方式,请求/响应(Request/Reply)是最常用的.在前面的博文的例子中,很多都是采用请求/响应的方式,当服务器接收到消息后,会立即write回写一条消息到客户端.HTTP协议也 ...
- RabbitMQ(三) -- Publish/Subscribe
RabbitMQ(三) -- Publish/Subscribe `rabbitmq`支持一对多的模式,一般称为发布/订阅.也就是说,生产者产生一条消息后,`rabbitmq`会把该消息分发给所有的消 ...
- ZeroMQ之Publish/Subscribe (Java)
前面的文章介绍了比较简单的Request/Subscribe模式, 这篇文章介绍更为经典的Publish/Subscribe通信模式用来ZeroMQ的实现,其通信方式如下图: 客户端(subscrib ...
- RabbitMQ学习总结 第四篇:发布/订阅 Publish/Subscribe
目录 RabbitMQ学习总结 第一篇:理论篇 RabbitMQ学习总结 第二篇:快速入门HelloWorld RabbitMQ学习总结 第三篇:工作队列Work Queue RabbitMQ学习总结 ...
- (转)RabbitMQ消息队列(四):分发到多Consumer(Publish/Subscribe)
上篇文章中,我们把每个Message都是deliver到某个Consumer.在这篇文章中,我们将会将同一个Message deliver到多个Consumer中.这个模式也被成为 "pub ...
- javascript设计模式——Publish/Subscribe
推荐阅读http://dev.housetrip.com/2014/09/15/decoupling-javascript-apps-using-pub-sub-pattern/ 我们先引出问题的所在 ...
随机推荐
- Linux操作系统分析__破解操作系统的奥秘
学号:SA12226343 姓名:sunhongbo 一.操作系统工作的基础 存储程序计算机和堆栈(函数调用堆栈)机制以及中断机制是操作系统工作的基础. 现代计算机仍采用存储程序计算机的结构体系和工 ...
- Win7下VS2010使用STLPort 和boost1.56.
STLport的下载地址 http://sourceforge.net/projects/stlport/ 下载后,解压出文件.我的目录是 D:\STLport-5.2.1 . 右键计算机,属性,高级 ...
- [目录][Leetcode] Leetcode 题解索引
之前想边做题边写结题报告,发现有点力不从心,而且很多地方也是一知半解,现在重新做题,重新理解.这篇文章主要起一个目录的作用. 目前没有什么特定的顺序,基本都是看心情翻牌的,哈哈~ 我在Github上新 ...
- 兄弟选择器 E + F
兄弟选择器在IE7下支持会有bug,特记于此 如果兄弟选择器有Html注释,兄弟选择器在IE7下会失效 代码如下 E + Fp + p{color:red} <p class="te ...
- css3滚动提示
<css揭秘>书中,滚动提示的实现 <!DOCTYPE html> <html lang="en"> <head> <meta ...
- windows下配置lamp环境(2)---配置Apache服务器2.2.25
配置Apache 配置Apache时,先要找到安装目录中的主配置文httpd.conf,使用文本编辑器打开,最好不要使用windows自带的编辑器,可以使用NotePad++, vim,或者subli ...
- Flask Jinjia2 与 react
Jinjia2 这是flask使用的模板工具,利用render_template方法可以方便的将后端的数据传给前端. 但是如果要使用react呢. 我如果在jsx中直接使用{{}}是不能输出变量的. ...
- Keil 3光标问题 以及汉字问题
初次使用keil3,光标总是定位不准,修改十分麻烦,google后解决问题,修改tools.ini如下(蓝色为加入项): NAME="YGLenovo User", "a ...
- [转]RegOpenKeyEx函数失败的问题
在使用这个函数RegOpenKeyEx的时候,老是执行不成功,函数本身返回2,GetLastError返回0.在CSDN上查阅资料说是返回2的原因是注册表中对应路径不存在,可是我电脑中注册表那个键值明 ...
- 玩转指针(Playing with Pointers)
Question: What is a Pointer? What are its limitations? What are its benefits? How do we use it? What ...