当前位置: 首页 > ActiveMQ in Action 读书笔记 > 正文

第三章 ActiveMQ 实例 – The ActiveMQ in Action examples

This chapter covers

 Introduction to the use case for each of the book examples

 Use of Maven for compiling and running the examples

 How to use the example applications with ActiveMQ





ActiveMQ provides all the features from the JMS specification and adds many more powerful features on top of that. This is depicted in figure 3.1 and these features will be discussed through the rest of the book. In order to best demonstrate these features, two new examples have been created that are modeled after real business domains. Compared to the example that’s part of the ActiveMQ distribution, these examples lend themselves to demonstrating the features in ActiveMQ in a more complete and easy manner.






One of the examples is based on a stock portfolio and the other is based on a

job queue. These two examples are more extensive than the examples that come

with ActiveMQ. The use case for each of these examples is introduced briefly, followed

by a deeper discussion of how to use them. You can refer back to this chapter

at any time throughout the book if you need a refresher on the examples.






The stock portfolio demonstrates the publish/subscribe messaging domain.

Publishers broadcast stock price messages to many interested subscribers.

Messages are published to a JMS destination called a topic and clients with

active subscriptions receive messages. Using this model, the broker delivers messages to each

subscriber without the need to poll for messages.

Every active subscriber receives its own copy of each message published to the topic.

Publishers are decoupled from subscribers via the topic. Unless durable subscriptions are

used, subscribers must be active in order to receive messages sent by publishers to the topic.

A copy of each message on a given destination is delivered to all topic subscribers using the pub/sub domain.


stock portfolio这个实例介绍了发布/订阅消息的使用.发布者广播股票价格消息给许多感兴趣的订阅者.








The job queue demonstrates the point-to-point (PTP) messaging domain. Message

producers send job messages to a JMS queue, from which message consumers receive

the job messages for processing. There’s no timing requirement for the producers

and consumers to be online at the same time with the point-to-point domain. The

queue holds messages until consumers are available to receive them. As consumers

are available, messages are delivered to all consumers, but no two consumers receive

the same message. Messages on a given destination are delivered to queue consumers

in a round-robin fashion using the PTP domain.


job queue这个实例介绍了点对点消息的使用(PTP).消息生产者发送job消息给JMS消息队列,消息






Not only is each example focused on a different messaging domain, but each is

also focused on a separate use case. Additionally, although the diagrams depicted later

in this chapter for each example look nearly the same at first glance, the important

difference between the two lies in the two messaging domains. The stock portfolio

example uses topics for pub/sub messaging, whereas the job queue example uses

queues for point-to-point messaging. The source for these examples is readily available

and can be downloaded from the Manning website via the following URL: http://





发送模型是不同的.stock portfolio实例使用主题实现消息的发布/订阅,而job queue的例子





In this chapter, first we’ll download Maven and install it in order to compile and

run the examples. After this is complete, we’ll review each example and demonstrate

how each one should behave. After the completion of these exercises, you’ll be familiar

enough with the examples to recognize them throughout the book and see how

they’re used to demonstrate the features in ActiveMQ.






   微信打赏  支付宝打赏

本文固定链接: https://www.jack-yin.com/coding/translation/activemq-in-action/502.html | 边城网事

该日志由 边城网事 于2013年09月22日发表在 ActiveMQ in Action 读书笔记 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: 第三章 ActiveMQ 实例 – The ActiveMQ in Action examples | 边城网事

第三章 ActiveMQ 实例 – The ActiveMQ in Action examples 暂无评论