【转】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/ 我们先引出问题的所在 ...
随机推荐
- Tree( 树) 组件[2]
本节课重点了解 EasyUI 中 Tree(树)组件的使用方法, 这个组件依赖于 Draggable(拖动)和 Droppable(放置)组件.一. 异步加载如果想从数据库里获取导航内容, 那么就必须 ...
- css3新增的背景属性
有时候我们需要往边框文字上添加背景与背景图片的时候就有用处了 background的css3有两个新增属性分别是background-clip与background-origin;背景-修剪与背景起点 ...
- 打开局域网项目,显示“项目位置不受信任”的解决办法(VS2008)
弄了几天,网上搜了个遍,愣是解决不了,绝望的时候闭着眼睛胡搞,居然解决了,哈哈.... 开发环境:visual studio 2008 项目位置:局域网其他电脑内 出现问题: 1.弹出“”的对话框,如 ...
- Geodatabase - 修改字段别名(Field Alias)
以下代码演示的是通过个人数据库打开要素类,并对指定的字段别名进行修改,其中,需要注意的是,不能通过Engine中的AxMapControl直接获得,如 //直接获得IFeatureClass. //E ...
- 《javascript设计模式》--接口
关于javascript设计模式书中的接口,记录如下 //TODO 增加了一个判断条件,可以只在生产环境中调用 接口var Interface = function(name,methods){ i ...
- SpringMVC项目中中文字符乱码问题及解决办法总结(非专业最优解决办法) -- ajax传值乱码; request.getParameter()乱码;
情况一: ajax中传值时是乱码(后台可以获取到中文字符,但用@ResponseBody返回时前台为乱码) 情况二: Controller 中 request.getParameter()获取到的是乱 ...
- Jquery简略API使用
都是个人随手笔记,既然开通了博客园就分享给大家.谨做为参考,具体大家自己测试以及使用 ★ $() ★ JQ的一个万能获取对象的函数(获取跟CSS获取元素是一样的)$(function(){}); 替代 ...
- Backbone一些参考资源
最近想找一个single-page JavaScript application Framework ,而不是单纯的Toolkit+Widget.来看YUI3的一段介绍: 引用 The YUI App ...
- PyQt4环境搭建与使用
初次使用python写图形界面的工具时,用了Tkinter.wxpython,都是需要手写界面布局的,看api看的头疼觉得这样写太费劲了,于是搜了下看看别人都是怎样写python图形界面的. 在论坛上 ...
- uc/os 笔记(转)
1.uC/OS-II中使用互斥信号对象应该注意 互斥信号对象(Mutual Exclusion Semaphore)简称Mutex,是uC/OS-II的内核对象之一,用于管理那些需要独占访问的资源,并 ...