博客已搬家, 更好阅读体验,猛戳 http://www.jack-yin.com/english/translation/activemq-in-action/1568.html
7.4 Writing JMS clients using Spring
7.4 使用Spring编写JMS客户端
ActiveMQ uses the Spring Framework to ease the various aspects of client-to-broker
communication, but the Spring Framework goes much further, with its API and container
designed specifically for JMS messaging. Together, ActiveMQ and Spring make
an excellent JMS development platform, making many common tasks extremely easy
to accomplish. Some of the tasks to be covered in this section include
ActiveMQ使用Spring框架来屏蔽客户端和代理之间通信的各种细节,但是Spring框架做的更好,Spring使用其
API和专为ActiveMQ进行特殊设计的JMS消息系统.ActiveMQ和Spring创造了卓越的JMS开发平台,可以轻松完成
大多数的普通任务.本章节中包含的JMS开发内容包括:
Configuring JMS connections—ActiveMQ provides classes that can be used to
configure URLs and other parameters of connections to brokers. The connection
factory could later be used by your application to get the appropriate
connection.
配置JMS连接 -- ActiveMQ提供了可以用来配置代理的RUL以及其他参数的类.而后你在程序中使用JMS的
连接工厂可以使用配种的适当的连接URL和其他连接参数来获取JMS连接.
Configuring JMS destinations—ActiveMQ destination objects can be configured
simply as beans representing JMS destinations used by your producers and
consumers.
配置JMS消息目的地 -- 可以配置一个普通的bean来代表JMS消息目的地, 以供消息生产者和消费者使用.
Defining JMS consumers—Spring provides helper classes that allow you to easily
configure a message listener container and hook message listeners to it.
定义JMS消息消费者--Spring提供的辅助类,允许您轻松地配置消息侦听容器和设置消息监听器钩子.
Implementing JMS producers—Spring also provides helper bean classes for creating
new producers.
实现JMS生产者 -- Spring通样也提供了辅助的bean用来创建新的消息生产者.
In the following sections, these tasks will be demonstrated and the portfolio application
will be changed to use all benefits of the ActiveMQ and Spring integration.
接下来的章节将介绍上文所述的任务,portfolio实例也会被修改以便利用ActiveMQ与Spring结合后的各种
好处.
7.4.1 Configuring JMS connections
7.4.1 配置JMS连接
....................