ActiveMQ系列—ActiveMQ中的Queue和Topics
来源:互联网 发布:公司数据保密协议范本 编辑:程序博客网 时间:2024/05/21 17:24
如果您细心的话,在ActiveMQ提供的管理页面上已经看到有两个功能页面:Queue和Topic。Queue和Topic是JMS为开发人员提供的两种不同工作机制的消息队列。 在ActiveMQ官方的解释是:
1、Topics
In JMS a Topic implements publish and subscribe semantics. When you publish a message it goes to all the subscribers who are interested - so zero to many subscribers will receive a copy of the message. Only subscribers who had an active subscription at the time the broker receives the message will get a copy of the message.
中文可以译做:JMS-Topic 队列基于“订阅-发布”模式,当操作者发布一条消息后,所有对这条消息感兴趣的订阅者都可以收到它——也就是说这条消息会被拷贝成多份,进行分发。只有当前“活动的”订阅者能够收到消息(换句话说,如果当前JMS-Topic队列中没有订阅者,这条消息将被丢弃)。
2、Queue
A JMS Queue implements load balancer semantics. A single message will be received by exactly one consumer. If there are no consumers available at the time the message is sent it will be kept until a consumer is available that can process the message. If a consumer receives a message and does not acknowledge it before closing then the message will be redelivered to another consumer. A queue can have many consumers with messages load balanced across the available consumers.
So Queues implement a reliable load balancer in JMS.
中文可以译做:JMS-Queue是一种“负载均衡模式”的实现。一个消息能且只能被一个消费者接受。如果当前JMS-Queue中没有任何的消费者,那么这条消息将会被Queue存储起来(实际应用中可以存储在磁盘上,也可以存储在数据库中,看软件的配置),直到有一个消费者连接上。另外,如果消费者在接受到消息后,在他断开与JMS-Queue连接之前,没有发送ack信息(可以是客户端手动发送,也可以是自动发送),那么这条消息将被发送给其他消费者。
以下表格摘自互联网上的资料,基本上把Queue和Topic这两种队列的不同特性说清楚了:
- ActiveMQ系列—ActiveMQ中的Queue和Topics
- ActiveMQ Queue和Topic
- ActiveMQ系列—ActiveMQ安装
- 淘淘商城系列——ActiveMQ发送queue消息
- JMS 服务器ActiveMQ Queue和Topic区别
- ActiveMQ定时删除过期Topic和Queue
- MQ系列3 使用Spring发送,消费topic和queue消息 activeMQ
- activemq 应用实践——queue
- activemq 应用实践——queue
- ActiveMQ—Queue与Topic区别
- ActiveMq-Queue开发
- Activemq学习笔记--Queue
- ActiveMQ发送queue消息
- ActiveMQ系列—ActiveMQ性能优化(中1)(处理规则和优化)
- ActiveMQ系列—ActiveMQ性能优化(中2)(处理规则和优化)
- ActiveMQ系列—ActiveMQ性能优化(中3)(消费者和生产者性能总结)
- ActiveMQ系列之二:ActiveMQ安装和基本使用
- ActiveMQ系列—JMS规范中的几个基本概念
- 2017 51信用卡秋招笔试题——JAVA研发
- 云原生(Cloud Native)- 移动App研发新范式
- 安卓7.0报错android.os.FileUriExposedException
- iOS-设置阴影和圆角效果
- ICPC2017南宁邀请赛1004&&HDU6197 (贪心
- ActiveMQ系列—ActiveMQ中的Queue和Topics
- ImportError: No module named 'memcache'
- HTML5 Web 存储
- C++复习第四天 auto关键字
- 9.18 test solution.
- 技术员 Ghost Win 10(x86/x64)企业版/专业版(附属Xp/Win7系统下载)
- 社交系统ThinkSNS V4后台有哪些“隐藏”不为人知的功能
- DOM事件处理方式
- 深入理解Java中为什么内部类可以访问外部类的成员