上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 27 下一页
  2018年4月11日
摘要: 消息的 destination 分为 queue 和 topic,而消费者称为 subscriber(订阅者)。queue 中的消息只会发送给一个订阅者,而 topic 的消息,会发送给每一个订阅者。在 broker 中,处理 queue 消息和 topic 消息的逻辑是不同的。queue 先存储消 阅读全文
posted @ 2018-04-11 11:37 偶尔发呆 阅读(2298) 评论(0) 推荐(0)
  2018年4月10日
摘要: ActiveMQ 中的消息在内存中时,以链表形式保存,以 PendingList 表示,每一个消息是 PendingNode。 PendingList 主要有2种实现:OrderedPendingList 和 PrioritizedPendingList OrderedPendingList 就是一 阅读全文
posted @ 2018-04-10 15:51 偶尔发呆 阅读(210) 评论(0) 推荐(0)
  2018年4月9日
摘要: ActiveMQ 的线程池实质上也是 ThreadPoolExecutor,不过它的任务模型有自己的特点,我们先看一个例子: Task 接口真正处理业务逻辑。factory.createTaskRunner 的作用只是创建一个命名的 PooledTaskRunner。 PooledTaskRunne 阅读全文
posted @ 2018-04-09 15:50 偶尔发呆 阅读(2009) 评论(0) 推荐(0)
  2018年4月8日
摘要: 在 ActiveMQ 中,broker 集中管理持久的、临时的 queue 和 topic。 最终的 Broker 链是这样的: StatisticsBroker -> TransactionBroker -> CompositeDestinationBroker -> AdvisoryBroker 阅读全文
posted @ 2018-04-08 15:39 偶尔发呆 阅读(1377) 评论(0) 推荐(0)
  2018年4月4日
摘要: 生产者发送消息:producer > broker broker返回确认:broker > producer 生产者发送同步消息,broker会返回Response;发送异步消息,broker不会返回确认;满足一定条件时,broker会返回ProducerAck: broker 分发消息:broke 阅读全文
posted @ 2018-04-04 10:39 偶尔发呆 阅读(1225) 评论(0) 推荐(0)
  2018年4月2日
摘要: http://activemq.apache.org/producer-flow-control.html 翻译: 流量控制是指:如果broker检测到destination的内存限制、temp文件限制、file store限制被超过了,就会减慢消息的流动。producer会被阻塞直到有可用资源,或 阅读全文
posted @ 2018-04-02 22:56 偶尔发呆 阅读(1257) 评论(0) 推荐(0)
  2018年4月1日
摘要: 在linux ext2文件系统中,一个文件的属性存放在inode中,而数据存放在block中。每个文件占用一个inode,inode中记录了文件的权限和block地址,通过inode可以定位到block。 在文件系统初始化后,inode和block的数量就确定了(所以大量小文件是会消耗inode的) 阅读全文
posted @ 2018-04-01 18:28 偶尔发呆 阅读(1833) 评论(0) 推荐(0)
  2018年3月30日
摘要: 正常情况下:consumer 消费完消息后,会发送"标准确认"给 broker,这个确认对象以 MessageAck 类表征: 但是当 consumer 处理消息失败时,会怎样呢?例如:发生了除数为 0,抛出异常 consumer 会进行重新投递,重新把消息给 listener 处理。具体流程是:c 阅读全文
posted @ 2018-03-30 14:26 偶尔发呆 阅读(1989) 评论(0) 推荐(0)
  2018年3月29日
摘要: http://activemq.apache.org/message-groups.html 与Exclusive Consumer相比,Message Groups的对消息分组的粒度更细。具有相同groupId的消息会被投送到同一个消费者,除非这个消费者挂了。 代码示例: 对应的代码在 org.a 阅读全文
posted @ 2018-03-29 18:03 偶尔发呆 阅读(2054) 评论(0) 推荐(0)
  2018年3月28日
摘要: 分页:即获取部分数据,queue按页从message cursor读取消息,然后分发给consumer。 页大小: 存放分页消息的数据结构: 把消息添加到分页中: 阅读全文
posted @ 2018-03-28 17:34 偶尔发呆 阅读(720) 评论(0) 推荐(0)
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 27 下一页