请问onmdppx是什么意思思?

From Wikipedia, the free encyclopedia
This article contains content that is written like . Please help
by removing
and inappropriate , and by adding encyclopedic content written from a . (July 2009)
Intrinsyc is a product development company that provides hardware, software, and service solutions that enable next-generation embedded and wireless products. Solutions span the development life cycle from concept to production and help device makers and technology suppliers create compelling differentiated products with faster time-to-market.
J-Integra COM is a high performance software bridge that enables Java interoperability with COM Automation (OLE) & ActiveX components via its pure Java implementation of the Microsoft DCOM wire protocol.
DragonBoard Development Kits are powerful, feature-rich, versatile, and easy-to-use exposed board platforms for component vendors, software and embedded developers. These full featured Android(TM) development platforms provide an ideal starting point for creating high-performance mobile and embedded devices. Based upon Qualcomm Technologies, Inc. powerful Qualcomm(R) Snapdragon(TM) S4 Plus APQ 8060A and 800 Series APQ 8074 processors, they include all of the software tools and accessories required to immediately begin development work. The platforms consist of a production ready System on Module (SoM) with a Snapdragon processor, a mini-ITX carrier board and a peripheral kit.
The Mobile Development Platform Tablet (MDP/T) based on a Qualcomm(R) Snapdragon(TM) 805 processor from Qualcomm Technologies, Inc., provides application developers and device manufacturers with early access to the highest-performance mobile platform, for developing, testing, optimizing and showcasing next-generation apps and games. Based on a Snapdragon 805 Ultra HD processor with four Krait(TM) 450 CPUs, this tablet includes a Qualcomm(R) Adreno(TM) 420 GPU and the newest Hexagon(TM) DSP. The tablet also features a 10.06” WQHD () display, 3 GB of RAM, 64 GB of high-speed storage and a microSD slot for memory expansion.
Qualcomm Technologies, Inc.
The Open Handset Alliance(TM)
Microsoft Windows Embedded Partner
GENIVI Alliance Member
Symbian Platinum Program
Symbian Competence Center
Texas Instruments
Freescale Semiconductor
Intrinsyc Software
1-800-474-7644 or (604) 801-6461
: Hidden categories:Android Overlay on QC MDP4平台要点简记 - zirconsdu的专栏
- 博客频道 - CSDN.NET
2964人阅读
首次post后仍会更新,转载请注明出处。
File Orgnization
目录/hardware/qcom/display/liboverlay/
Android.mk
mdpRotator.cpp&&&&&&&&&&&&&& Overlay Rotator Wrpper
mdpWrapper.h &&&&&&&&&&&&&&& MDP Normal and Overlay FrameBuffer IOCTL Wrapper
mdssRotator.cpp&&&&&&&&&&&& Overlay MDSS Rotator Wrapper
overlay.cpp&&&&&&& Overlay Top level implementation file
overlay.h&&&&&&&&&&&& Overlay Top level declaration file
overlayCtrl.cpp & OverlayCtrl implementation file
overlayCtrlData.h&&&&&& OverlayCtrl and OverlayData declaration file including OverlayData implementation
overlayImpl.h&&& Overlay implementation which operates overlay pipes pair(LayerMixer)&&&&&&&&&&&&&&
overlayMdp.cpp&&& Overlay implementation on MDP, used by OverlayCtrlData&&&&
overlayMdp.h&& Overlay on MDP
overlayMem.h& Overlay VG pipe input kernel memory file descriptor, maybe graphic buffer or rotator output buffer
overlayRotator.cpp&&&&&&&& Overlay Rotator top level implementation
overlayRotator.h&&&&&&&&&&&&& Overlay Rotator top level declaration
overlayState.h& Overlay state machine
overlayUtils.cpp&&&&&&&&&&&&&& & Overlay Utils
overlayUtils.h&&& Overlay Utils
pipes/&& Overlay Pipes, that is Overlay channel. It is a VG and RGB pipe pair on MDP.
Platform architecture
MDP中每个VG和RGB pipe pair作为一个LayerMixer的输入,由LayerMixer完成Overlay功能,作为一个Overlay
注意,RGB和VG并不固定配对做为某个LayerMixer的输入。如MDP4.2的LayerMixer0可以合成一个Border或BaseLayer和4个layer,即可以多达5个pipe输入到LayerMixer0,从而用作Hardware Composer。
当使用Overlay功能时:
RGB pipe的输入是普通的Framebuffer,是Surfaceflinger的合成输出;
VG的输入是video或graphics或camera图像等,是内核空间内存buffer,其owner一般是Video、Graphics或V4L2等。当其前端是Rotator时,Rotator的输入是这些buffer,Rotator的输出Overlay
rotator frame buffer作为VG的输入。
每个Overlay Channel结构如下图所示
关于Overlay Buffer(FrameBuffer RotatorBuffer OverlayBuffer)这些名称并不特别明确,只要明白Overlay Channel数据流路上的各输入输出Buffer的位置和作用即可。
下面以Layermixer1(对应/dev/graphics/fb0)为参考详述各buffer:
只UI显示时,
Framebuffer是fb0的framebuffer,是从启动时预留出的bootmem中的分配出来的。LayerMixer1处于BLT模式,Layermixer1和DMA_P(Primary display driver)分离,可以由软件完全控制。该Framebuffer做为DMA_P的输入,经MIPI_DSI输出到主屏上。
启用Overlay时,
上述Framebuffer做为RGB1 pipe的输入,而视频或图像的内核buffer做为VG pipe的输入,二者经Layermixer1合成;此时LayerMixer1工作在非BLT模式,LayerMixer1和DMA_P attach在一起,LayerMixer1输出控制参数直接提供给DMA_P使用。此时LayerMixer1仍有两种工作模式,FrameBuffer模式和DIRECT_OUT模式,前者时LayerMixer1和DMA_P之间使用一个overlaydouble
buffer做缓冲,输出给DMA_P;DIRECT_OUT模式下不使用该ovl double buffer,LayerMixer1直接输出给DMA_P。
一般VG和RGB的输入都可以是double buffer,ping-pang;LayerMixer的输出也是double
buffer。DMA_P/S/E做为display driver传输前端buffer作为后端接口控制器的输入。
下面两图是QC MDP UI mirror和Video mirror时的两结构图,并没有明确画出LayerMix1的Overlay流程路径,个别buffer的owner可能也有所差错,buffer也并不全,仅是大致描述Overlay及其部分buffer。
MDP和DSI和后端显示控制器和接口的连接结构如下图。
Layer architecture
Overlay&& -&& OverlayImpl
OverlayCtrlData
OverlayMDPCtrlData
MDPWrapper
FrameBuffer
Ctrl用来设置overlay channel的参数,Data用来提交buffer到Overlay
channel queue。其实使用overlay本质上就是设置好pin路由,设置好通道工作参数,然后不停的提交数据让Overlay Enginee工作。MDP的Overlay
Channel并没有别的特殊的编程接口,都是使用控制、状态和数据寄存器来访问。其实MDP提供了远比Android Overlay实现强得多的Overlay功能。
Ctrl::commit()& -&& MDPCtrl::set() -& mdp_wrapper::setOverlay() &-& ioctl(fd, MSMFB_OVERLAY_SET, &ov)
-& msm_fb -& mdp4_overlay设置Overlay工作参数。
Data::queueBuffer -& MDPData::play -& mdp_wrapper::play() -& ioctl(fd, MSMFB_OVERLAY_PLAY, &od)
-& msm_fb -& mdp4_overlay进行Overlay合成。注意queueBuffer第一参数fd是memFd,是内核空间的buffer,并不在用户空间和内核空间拷贝buffer数据。作用与framebuffer类似的是提交内核空间的该buffer到Overlay Enginee
有了这些平台相关知识,msm_fb和mdp4_overlay驱动的功能也就容易理解了。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:235142次
积分:3035
积分:3035
排名:第5047名
原创:61篇
转载:76篇
评论:45条
(1)(1)(4)(1)(3)(3)(12)(8)(13)(19)(1)(8)(6)(18)(9)(2)(7)(1)(1)(1)(5)(7)(6)MDP Chartered Professional Accountants - MDP Chartered Professional Accountants
Forget your password?
Username or E-mail
Site Under Construction
Welcome to MDP CHARTERED PROFESSIONAL ACCOUNTANTS
Growth is not valuable if it’s ‘here today and gone tomorrow.’ Our advice does not rely on schemes or unproven techniques. We take the time to understand your business needs, apply our professional capabilities, and then provide you with meaningful advice that will enhance the financial position of your business-today and tomorrow. MDP combines the knowledge and experience of a large accounting firm with the personal attention and availability you appreciate from a hands-on entrepreneurial firm.
Company Profile
MDP Chartered Professional Accountants was established in 1992. Our firm is comprised of professionals who have obtained their expertise from two long-established accounting firms.
The MDP Team
The team at MDP Chartered Professional Accountants is made up of a diverse line-up of partners and professionals whose expertise comes from two main national/international firms.
Financial Resources
To help keep you up-to-date and your tax affairs organized, we provide various financial resources including budgets, checklists, websites, informative updates & more.
Accounting Services
MDP Chartered Professional Accountants
Established in 1992, MDP is an accounting firm serving individuals and small to large businesses throughout the Greater Toronto Area and across Ontario with professional tax and accounting services.
Contact Us
Send us an e-mail and we'll respond to you as soon as possible!24.&JMS (Java Message Service)24.&JMS (Java Message Service)
24.1&Introduction
Spring provides a JMS integration framework that simplifies the use of the JMS API much
like Spring’s integration does for the JDBC API.
JMS can be roughly divided into two areas of functionality, namely the production and
consumption of messages. The JmsTemplate class is used for message production and
synchronous message reception. For asynchronous reception similar to Java EE’s
message-driven bean style, Spring provides a number of message listener containers that
are used to create Message-Driven POJOs (MDPs). Spring also provides a declarative way
of creating message listeners.
The package org.springframework.jms.core provides the core functionality for using
JMS. It contains JMS template classes that simplify the use of the JMS by handling the
creation and release of resources, much like the JdbcTemplate does for JDBC. The
design principle common to Spring template classes is to provide helper methods to
perform common operations and for more sophisticated usage, delegate the essence of the
processing task to user implemented callback interfaces. The JMS template follows the
same design. The classes offer various convenience methods for the sending of messages,
consuming a message synchronously, and exposing the JMS session and message producer to
The package org.springframework.jms.support provides JMSException translation
functionality. The translation converts the checked JMSException hierarchy to a
mirrored hierarchy of unchecked exceptions. If there are any provider specific
subclasses of the checked javax.jms.JMSException, this exception is wrapped in the
unchecked UncategorizedJmsException.
The package org.springframework.jms.support.converter provides a MessageConverter
abstraction to convert between Java objects and JMS messages.
The package org.springframework.jms.support.destination provides various strategies
for managing JMS destinations, such as providing a service locator for destinations
stored in JNDI.
The package org.springframework.jms.annotation provides the necessary infrastructure
to support annotation-driven listener endpoints using @JmsListener.
The package org.springframework.jms.config provides the parser implementation for the
jms namespace as well the java config support to configure listener containers and
create listener endpoints.
Finally, the package org.springframework.jms.connection provides an implementation of
the ConnectionFactory suitable for use in standalone applications. It also contains an
implementation of Spring’s PlatformTransactionManager for JMS (the cunningly named
JmsTransactionManager). This allows for seamless integration of JMS as a transactional
resource into Spring’s transaction management mechanisms.
24.2&Using Spring JMS
24.2.1&JmsTemplate
The JmsTemplate class is the central class in the JMS core package. It simplifies the
use of JMS since it handles the creation and release of resources when sending or
synchronously receiving messages.
Code that uses the JmsTemplate only needs to implement callback interfaces giving them
a clearly defined high level contract. The MessageCreator callback interface creates a
message given a Session provided by the calling code in JmsTemplate. In order to
allow for more complex usage of the JMS API, the callback SessionCallback provides the
user with the JMS session and the callback ProducerCallback exposes a Session and
MessageProducer pair.
The JMS API exposes two types of send methods, one that takes delivery mode, priority,
and time-to-live as Quality of Service (QOS) parameters and one that takes no QOS
parameters which uses default values. Since there are many send methods in
JmsTemplate, the setting of the QOS parameters have been exposed as bean properties to
avoid duplication in the number of send methods. Similarly, the timeout value for
synchronous receive calls is set using the property setReceiveTimeout.
Some JMS providers allow the setting of default QOS values administratively through the
configuration of the ConnectionFactory. This has the effect that a call to
MessageProducer's send method send(Destination destination, Message message) will
use different QOS default values than those specified in the JMS specification. In order
to provide consistent management of QOS values, the JmsTemplate must therefore be
specifically enabled to use its own QOS values by setting the boolean property
isExplicitQosEnabled to true.
For convenience, JmsTemplate also exposes a basic request-reply operation that allows
to send a message and wait for a reply on a temporary queue that is created as part of
the operation.
Instances of the JmsTemplate class are thread-safe once configured. This is
important because it means that you can configure a single instance of a JmsTemplate
and then safely inject this shared reference into multiple collaborators. To be
clear, the JmsTemplate is stateful, in that it maintains a reference to a
ConnectionFactory, but this state is not conversational state.
As of Spring Framework 4.1, JmsMessagingTemplate is built on top of JmsTemplate
and provides an integration with the messaging abstraction, i.e.
org.springframework.messaging.Message. This allows you to create the message to
send in generic manner.
24.2.2&Connections
The JmsTemplate requires a reference to a ConnectionFactory. The ConnectionFactory
is part of the JMS specification and serves as the entry point for working with JMS. It
is used by the client application as a factory to create connections with the JMS
provider and encapsulates various configuration parameters, many of which are vendor
specific such as SSL configuration options.
When using JMS inside an EJB, the vendor provides implementations of the JMS interfaces
so that they can participate in declarative transaction management and perform pooling
of connections and sessions. In order to use this implementation, Java EE containers
typically require that you declare a JMS connection factory as a resource-ref inside
the EJB or servlet deployment descriptors. To ensure the use of these features with the
JmsTemplate inside an EJB, the client application should ensure that it references the
managed implementation of the ConnectionFactory.
Caching Messaging Resources
The standard API involves creating many intermediate objects. To send a message the
following API walk is performed
ConnectionFactory-&Connection-&Session-&MessageProducer-&send
Between the ConnectionFactory and the Send operation there are three intermediate
objects that are created and destroyed. To optimise the resource usage and increase
performance two implementations of ConnectionFactory are provided.
SingleConnectionFactory
Spring provides an implementation of the ConnectionFactory interface,
SingleConnectionFactory, that will return the same Connection on all
createConnection() calls and ignore calls to close(). This is useful for testing and
standalone environments so that the same connection can be used for multiple
JmsTemplate calls that may span any number of transactions. SingleConnectionFactory
takes a reference to a standard ConnectionFactory that would typically come from JNDI.
CachingConnectionFactory
The CachingConnectionFactory extends the functionality of SingleConnectionFactory
and adds the caching of Sessions, MessageProducers, and MessageConsumers. The initial
cache size is set to 1, use the property SessionCacheSize to increase the number of
cached sessions. Note that the number of actual cached sessions will be more than that
number as sessions are cached based on their acknowledgment mode, so there can be up to
4 cached session instances when SessionCacheSize is set to one, one for each
AcknowledgementMode. MessageProducers and MessageConsumers are cached within their
owning session and also take into account the unique properties of the producers and
consumers when caching. MessageProducers are cached based on their destination.
MessageConsumers are cached based on a key composed of the destination, selector,
noLocal delivery flag, and the durable subscription name (if creating durable consumers).
24.2.3&Destination Management
Destinations, like ConnectionFactories, are JMS administered objects that can be stored
and retrieved in JNDI. When configuring a Spring application context you can use the
JNDI factory class JndiObjectFactoryBean / &jee:jndi-lookup& to perform dependency
injection on your object’s references to JMS destinations. However, often this strategy
is cumbersome if there are a large number of destinations in the application or if there
are advanced destination management features unique to the JMS provider. Examples of
such advanced destination management would be the creation of dynamic destinations or
support for a hierarchical namespace of destinations. The JmsTemplate delegates the
resolution of a destination name to a JMS destination object to an implementation of the
interface DestinationResolver. DynamicDestinationResolver is the default
implementation used by JmsTemplate and accommodates resolving dynamic destinations. A
JndiDestinationResolver is also provided that acts as a service locator for
destinations contained in JNDI and optionally falls back to the behavior contained in
DynamicDestinationResolver.
Quite often the destinations used in a JMS application are only known at runtime and
therefore cannot be administratively created when the application is deployed. This is
often because there is shared application logic between interacting system components
that create destinations at runtime according to a well-known naming convention. Even
though the creation of dynamic destinations is not part of the JMS specification, most
vendors have provided this functionality. Dynamic destinations are created with a name
defined by the user which differentiates them from temporary destinations and are often
not registered in JNDI. The API used to create dynamic destinations varies from provider
to provider since the properties associated with the destination are vendor specific.
However, a simple implementation choice that is sometimes made by vendors is to
disregard the warnings in the JMS specification and to use the TopicSession method
createTopic(String topicName) or the QueueSession method createQueue(String
queueName) to create a new destination with default destination properties. Depending
on the vendor implementation, DynamicDestinationResolver may then also create a
physical destination instead of only resolving one.
The boolean property pubSubDomain is used to configure the JmsTemplate with
knowledge of what JMS domain is being used. By default the value of this property is
false, indicating that the point-to-point domain, Queues, will be used. This property
used by JmsTemplate determines the behavior of dynamic destination resolution via
implementations of the DestinationResolver interface.
You can also configure the JmsTemplate with a default destination via the property
defaultDestination. The default destination will be used with send and receive
operations that do not refer to a specific destination.
24.2.4&Message Listener Containers
One of the most common uses of JMS messages in the EJB world is to drive message-driven
beans (MDBs). Spring offers a solution to create message-driven POJOs (MDPs) in a way
that does not tie a user to an EJB container. (See
for detailed coverage of Spring’s MDP support.) As from Spring Framework 4.1, endpoint
methods can be simply annotated using @JmsListener see
A message listener container is used to receive messages from a JMS message queue and
drive the MessageListener that is injected into it. The listener container is
responsible for all threading of message reception and dispatches into the listener for
processing. A message listener container is the intermediary between an MDP and a
messaging provider, and takes care of registering to receive messages, participating in
transactions, resource acquisition and release, exception conversion and suchlike. This
allows you as an application developer to write the (possibly complex) business logic
associated with receiving a message (and possibly responding to it), and delegates
boilerplate JMS infrastructure concerns to the framework.
There are two standard JMS message listener containers packaged with Spring, each with
its specialised feature set.
SimpleMessageListenerContainer
This message listener container is the simpler of the two standard flavors. It creates a
fixed number of JMS sessions and consumers at startup, registers the listener using the
standard JMS MessageConsumer.setMessageListener() method, and leaves it up the JMS
provider to perform listener callbacks. This variant does not allow for dynamic adaption
to runtime demands or for participation in externally managed transactions.
Compatibility-wise, it stays very close to the spirit of the standalone JMS
specification - but is generally not compatible with Java EE’s JMS restrictions.
DefaultMessageListenerContainer
This message listener container is the one used in most cases. In contrast to
SimpleMessageListenerContainer, this container variant does allow for dynamic adaption
to runtime demands and is able to participate in externally managed transactions. Each
received message is registered with an XA transaction when configured with a
JtaTransactionManager; so processing may take advantage of XA transaction semantics.
This listener container strikes a good balance between low requirements on the JMS
provider, advanced functionality such as transaction participation, and compatibility
with Java EE environments.
The cache level of the container can be customized. Note that when no caching is enabled,
a new connection and a new session is created for each message reception. Combining this
with a non durable subscription with high loads may lead to message lost. Make sure to
use a proper cache level in such case.
This container also has recoverable capabilities when the broker goes down. By default,
a simple BackOff implementation retries every 5 seconds. It is possible to specify
a custom BackOff implementation for more fine-grained recovery options, see
ExponentialBackOff for an example.
24.2.5&Transaction management
Spring provides a JmsTransactionManager that manages transactions for a single JMS
ConnectionFactory. This allows JMS applications to leverage the managed transaction
features of Spring as described in . The JmsTransactionManager performs
local resource transactions, binding a JMS Connection/Session pair from the specified
ConnectionFactory to the thread. JmsTemplate automatically detects such
transactional resources and operates on them accordingly.
In a Java EE environment, the ConnectionFactory will pool Connections and Sessions, so
those resources are efficiently reused across transactions. In a standalone environment,
using Spring’s SingleConnectionFactory will result in a shared JMS Connection, with
each transaction having its own independent Session. Alternatively, consider the use
of a provider-specific pooling adapter such as ActiveMQ’s PooledConnectionFactory
JmsTemplate can also be used with the JtaTransactionManager and an XA-capable JMS
ConnectionFactory for performing distributed transactions. Note that this requires the
use of a JTA transaction manager as well as a properly XA-configured ConnectionFactory!
(Check your Java EE server’s / JMS provider’s documentation.)
Reusing code across a managed and unmanaged transactional environment can be confusing
when using the JMS API to create a Session from a Connection. This is because the
JMS API has only one factory method to create a Session and it requires values for the
transaction and acknowledgement modes. In a managed environment, setting these values is
the responsibility of the environment’s transactional infrastructure, so these values
are ignored by the vendor’s wrapper to the JMS Connection. When using the JmsTemplate
in an unmanaged environment you can specify these values through the use of the
properties sessionTransacted and sessionAcknowledgeMode. When using a
PlatformTransactionManager with JmsTemplate, the template will always be given a
transactional JMS Session.
24.3&Sending a Message
The JmsTemplate contains many convenience methods to send a message. There are send
methods that specify the destination using a javax.jms.Destination object and those
that specify the destination using a string for use in a JNDI lookup. The send method
that takes no destination argument uses the default destination.
import javax.jms.ConnectionF
import javax.jms.JMSE
import javax.jms.M
import javax.jms.Q
import javax.jms.S
import org.springframework.jms.core.MessageC
import org.springframework.jms.core.JmsT
public class JmsQueueSender {
private JmsTemplate jmsT
public void setConnectionFactory(ConnectionFactory cf) {
this.jmsTemplate = new JmsTemplate(cf);
public void setQueue(Queue queue) {
this.queue =
public void simpleSend() {
this.jmsTemplate.send(this.queue, new MessageCreator() {
public Message createMessage(Session session) throws JMSException {
return session.createTextMessage("hello queue world");
This example uses the MessageCreator callback to create a text message from the
supplied Session object. The JmsTemplate is constructed by passing a reference to a
ConnectionFactory. As an alternative, a zero argument constructor and
connectionFactory is provided and can be used for constructing the instance in
JavaBean style (using a BeanFactory or plain Java code). Alternatively, consider
deriving from Spring’s JmsGatewaySupport convenience base class, which provides
pre-built bean properties for JMS configuration.
The method send(String destinationName, MessageCreator creator) lets you send a
message using the string name of the destination. If these names are registered in JNDI,
you should set the destinationResolver property of the template to an instance of
JndiDestinationResolver.
If you created the JmsTemplate and specified a default destination, the
send(MessageCreator c) sends a message to that destination.
24.3.1&Using Message Converters
In order to facilitate the sending of domain model objects, the JmsTemplate has
various send methods that take a Java object as an argument for a message’s data
content. The overloaded methods convertAndSend() and receiveAndConvert() in
JmsTemplate delegate the conversion process to an instance of the MessageConverter
interface. This interface defines a simple contract to convert between Java objects and
JMS messages. The default implementation SimpleMessageConverter supports conversion
between String and TextMessage, byte[] and BytesMesssage, and java.util.Map
and MapMessage. By using the converter, you and your application code can focus on the
business object that is being sent or received via JMS and not be concerned with the
details of how it is represented as a JMS message.
The sandbox currently includes a MapMessageConverter which uses reflection to convert
between a JavaBean and a MapMessage. Other popular implementation choices you might
implement yourself are Converters that use an existing XML marshalling package, such as
JAXB, Castor, XMLBeans, or XStream, to create a TextMessage representing the object.
To accommodate the setting of a message’s properties, headers, and body that can not be
generically encapsulated inside a converter class, the MessagePostProcessor interface
gives you access to the message after it has been converted, but before it is sent. The
example below demonstrates how to modify a message header and a property after a
java.util.Map is converted to a message.
public void sendWithConversion() {
Map map = new HashMap();
map.put("Name", "Mark");
map.put("Age", new Integer(47));
jmsTemplate.convertAndSend("testQueue", map, new MessagePostProcessor() {
public Message postProcessMessage(Message message) throws JMSException {
message.setIntProperty("AccountID", 1234);
message.setJMSCorrelationID("123-00001");
This results in a message of the form:
MapMessage={
... standard headers ...
CorrelationID={123-00001}
Properties={
AccountID={Integer:1234}
Name={String:Mark}
Age={Integer:47}
24.3.2&SessionCallback and ProducerCallback
While the send operations cover many common usage scenarios, there are cases when you
want to perform multiple operations on a JMS Session or MessageProducer. The
SessionCallback and ProducerCallback expose the JMS Session and Session /
MessageProducer pair respectively. The execute() methods on JmsTemplate execute
these callback methods.
24.4&Receiving a message
24.4.1&Synchronous Reception
While JMS is typically associated with asynchronous processing, it is possible to
consume messages synchronously. The overloaded receive(..) methods provide this
functionality. During a synchronous receive, the calling thread blocks until a message
becomes available. This can be a dangerous operation since the calling thread can
potentially be blocked indefinitely. The property receiveTimeout specifies how long
the receiver should wait before giving up waiting for a message.
24.4.2&Asynchronous Reception - Message-Driven POJOs
Spring also supports annotated-listener endpoints through the use of the @JmsListener
annotation and provides an open infrastructure to register endpoints programmatically. This
is by far the most convenient way to setup an asynchronous receiver, see
for more details.
In a fashion similar to a Message-Driven Bean (MDB) in the EJB world, the Message-Driven
POJO (MDP) acts as a receiver for JMS messages. The one restriction (but see also below
for the discussion of the MessageListenerAdapter class) on an MDP is that it must
implement the javax.jms.MessageListener interface. Please also be aware that in the
case where your POJO will be receiving messages on multiple threads, it is important to
ensure that your implementation is thread-safe.
Below is a simple implementation of an MDP:
import javax.jms.JMSE
import javax.jms.M
import javax.jms.MessageL
import javax.jms.TextM
public class ExampleListener implements MessageListener {
public void onMessage(Message message) {
if (message instanceof TextMessage) {
System.out.println(((TextMessage) message).getText());
catch (JMSException ex) {
throw new RuntimeException(ex);
throw new IllegalArgumentException("Message must be of type TextMessage");
Once you’ve implemented your MessageListener, it’s time to create a message listener
container.
Find below an example of how to define and configure one of the message listener
containers that ships with Spring (in this case the DefaultMessageListenerContainer).
id="messageListener" class="jmsexample.ExampleListener"
id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"
name="connectionFactory" ref="connectionFactory"
name="destination" ref="destination"
&property name="messageListener" ref="messageListener" /&
Please refer to the Spring javadocs of the various message listener containers for a full
description of the features supported by each implementation.
24.4.3&the SessionAwareMessageListener interface
The SessionAwareMessageListener interface is a Spring-specific interface that provides
a similar contract to the JMS MessageListener interface, but also provides the message
handling method with access to the JMS Session from which the Message was received.
package org.springframework.jms.
public interface SessionAwareMessageListener {
void onMessage(Message message, Session session) throws JMSE
You can choose to have your MDPs implement this interface (in preference to the standard
JMS MessageListener interface) if you want your MDPs to be able to respond to any
received messages (using the Session supplied in the onMessage(Message, Session)
method). All of the message listener container implementations that ship with Spring
have support for MDPs that implement either the MessageListener or
SessionAwareMessageListener interface. Classes that implement the
SessionAwareMessageListener come with the caveat that they are then tied to Spring
through the interface. The choice of whether or not to use it is left entirely up to you
as an application developer or architect.
Please note that the 'onMessage(..)' method of the SessionAwareMessageListener
interface throws JMSException. In contrast to the standard JMS MessageListener
interface, when using the SessionAwareMessageListener interface, it is the
responsibility of the client code to handle any exceptions thrown.
24.4.4&the MessageListenerAdapter
The MessageListenerAdapter class is the final component in Spring’s asynchronous
messaging support: in a nutshell, it allows you to expose almost any class as a MDP
(there are of course some constraints).
Consider the following interface definition. Notice that although the interface extends
neither the MessageListener nor SessionAwareMessageListener interfaces, it can still
be used as a MDP via the use of the MessageListenerAdapter class. Notice also how the
various message handling methods are strongly typed according to the contents of the
various Message types that they can receive and handle.
public interface MessageDelegate {
void handleMessage(String message);
void handleMessage(Map message);
void handleMessage(byte[] message);
void handleMessage(Serializable message);
public class DefaultMessageDelegate implements MessageDelegate {
In particular, note how the above implementation of the MessageDelegate interface (the
above DefaultMessageDelegate class) has no JMS dependencies at all. It truly is a
POJO that we will make into an MDP via the following configuration.
&bean id="messageListener" class="org.springframework.jms.listener.adapter.MessageListenerAdapter"&
&constructor-arg&
&bean class="jmsexample.DefaultMessageDelegate"/&
&/constructor-arg&
id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"
name="connectionFactory" ref="connectionFactory"
name="destination" ref="destination"
&property name="messageListener" ref="messageListener" /&
Below is an example of another MDP that can only handle the receiving of JMS
TextMessage messages. Notice how the message handling method is actually called
'receive' (the name of the message handling method in a MessageListenerAdapter
defaults to 'handleMessage'), but it is configurable (as you will see below). Notice
also how the 'receive(..)' method is strongly typed to receive and respond only to JMS
TextMessage messages.
public interface TextMessageDelegate {
void receive(TextMessage message);
public class DefaultTextMessageDelegate implements TextMessageDelegate {
The configuration of the attendant MessageListenerAdapter would look like this:
id="messageListener" class="org.springframework.jms.listener.adapter.MessageListenerAdapter"
class="jmsexample.DefaultTextMessageDelegate"
name="defaultListenerMethod" value="receive"
name="messageConverter"
Please note that if the above 'messageListener' receives a JMS Message of a type
other than TextMessage, an IllegalStateException will be thrown (and subsequently
swallowed). Another of the capabilities of the MessageListenerAdapter class is the
ability to automatically send back a response Message if a handler method returns a
non-void value. Consider the interface and class:
public interface ResponsiveTextMessageDelegate {
String receive(TextMessage message);
public class DefaultResponsiveTextMessageDelegate implements ResponsiveTextMessageDelegate {
If the above DefaultResponsiveTextMessageDelegate is used in conjunction with a
MessageListenerAdapter then any non-null value that is returned from the execution of
the 'receive(..)' method will (in the default configuration) be converted into a
TextMessage. The resulting TextMessage will then be sent to the Destination (if
one exists) defined in the JMS Reply-To property of the original Message, or the
default Destination set on the MessageListenerAdapter (if one has been configured);
if no Destination is found then an InvalidDestinationException will be thrown (and
please note that this exception will not be swallowed and will propagate up the
call stack).
24.4.5&Processing messages within transactions
Invoking a message listener within a transaction only requires reconfiguration of the
listener container.
Local resource transactions can simply be activated through the sessionTransacted flag
on the listener container definition. Each message listener invocation will then operate
within an active JMS transaction, with message reception rolled back in case of listener
execution failure. Sending a response message (via SessionAwareMessageListener) will
be part of the same local transaction, but any other resource operations (such as
database access) will operate independently. This usually requires duplicate message
detection in the listener implementation, covering the case where database processing
has committed but message processing failed to commit.
id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"
name="connectionFactory" ref="connectionFactory"
name="destination" ref="destination"
name="messageListener" ref="messageListener"
&property name="sessionTransacted" value="true"/&
For participating in an externally managed transaction, you will need to configure a
transaction manager and use a listener container which supports externally managed
transactions: typically DefaultMessageListenerContainer.
To configure a message listener container for XA transaction participation, you’ll want
to configure a JtaTransactionManager (which, by default, delegates to the Java EE
server’s transaction subsystem). Note that the underlying JMS ConnectionFactory needs to
be XA-capable and properly registered with your JTA transaction coordinator! (Check your
Java EE server’s configuration of JNDI resources.) This allows message reception as well
as e.g. database access to be part of the same transaction (with unified commit
semantics, at the expense of XA transaction log overhead).
id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"
Then you just need to add it to our earlier container configuration. The container will
take care of the rest.
id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"
name="connectionFactory" ref="connectionFactory"
name="destination" ref="destination"
name="messageListener" ref="messageListener"
&property name="transactionManager" ref="transactionManager"/&
24.5&Support for JCA Message Endpoints
Beginning with version 2.5, Spring also provides support for a JCA-based
MessageListener container. The JmsMessageEndpointManager will attempt to
automatically determine the ActivationSpec class name from the provider’s
ResourceAdapter class name. Therefore, it is typically possible to just provide
Spring’s generic JmsActivationSpecConfig as shown in the following example.
class="org.springframework.jms.listener.endpoint.JmsMessageEndpointManager"
name="resourceAdapter" ref="resourceAdapter"
name="activationSpecConfig"
class="org.springframework.jms.listener.endpoint.JmsActivationSpecConfig"
name="destinationName" value="myQueue"
name="messageListener" ref="myMessageListener"
Alternatively, you may set up a JmsMessageEndpointManager with a given
ActivationSpec object. The ActivationSpec object may also come from a JNDI lookup
(using &jee:jndi-lookup&).
class="org.springframework.jms.listener.endpoint.JmsMessageEndpointManager"
name="resourceAdapter" ref="resourceAdapter"
name="activationSpec"
class="org.apache.activemq.ra.ActiveMQActivationSpec"
name="destination" value="myQueue"
name="destinationType" value="javax.jms.Queue"
name="messageListener" ref="myMessageListener"
Using Spring’s ResourceAdapterFactoryBean, the target ResourceAdapter may be
configured locally as depicted in the following example.
id="resourceAdapter" class="org.springframework.jca.support.ResourceAdapterFactoryBean"
name="resourceAdapter"
class="org.apache.activemq.ra.ActiveMQResourceAdapter"
name="serverUrl" value="tcp://localhost:61616"
name="workManager"
class="org.springframework.jca.work.SimpleTaskWorkManager"
The specified WorkManager may also point to an environment-specific thread pool -
typically through SimpleTaskWorkManager's "asyncTaskExecutor" property. Consider
defining a shared thread pool for all your ResourceAdapter instances if you happen to
use multiple adapters.
In some environments (e.g. WebLogic 9 or above), the entire ResourceAdapter object may
be obtained from JNDI instead (using &jee:jndi-lookup&). The Spring-based message
listeners can then interact with the server-hosted ResourceAdapter, also using the
server’s built-in WorkManager.
Please consult the JavaDoc for JmsMessageEndpointManager, JmsActivationSpecConfig,
and ResourceAdapterFactoryBean for more details.
Spring also provides a generic JCA message endpoint manager which is not tied to JMS:
org.springframework.jca.endpoint.GenericMessageEndpointManager. This component allows
for using any message listener type (e.g. a CCI MessageListener) and any
provider-specific ActivationSpec object. Check out your JCA provider’s documentation to
find out about the actual capabilities of your connector, and consult
GenericMessageEndpointManager's JavaDoc for the Spring-specific configuration details.
JCA-based message endpoint management is very analogous to EJB 2.1 Message-Driven B
it uses the same underlying resource provider contract. Like with EJB 2.1 MDBs, any
message listener interface supported by your JCA provider can be used in the Spring
context as well. Spring nevertheless provides explicit convenience support for JMS,
simply because JMS is the most common endpoint API used with the JCA endpoint management
24.6&Annotation-driven listener endpoints
The easiest way to receive a message asynchronously is to use the annotated listener
endpoint infrastructure. In a nutshell, it allows you to expose a method of a managed
bean as a JMS listener endpoint.
@Component
public class MyService {
@JmsListener(destination = "myDestination")
public void processOrder(String data) { ... }
The idea of the example above is that whenever a message is available on the
javax.jms.Destination "myDestination", the processOrder method is invoked
accordingly (in this case, with the content of the JMS message similarly to
provides).
The annotated endpoint infrastructure creates a message listener container
behind the scenes for each annotated method, using a JmsListenerContainerFactory.
24.6.1&Enable listener endpoint annotations
To enable support for @JmsListener annotations add @EnableJms to one of
your @Configuration classes.
@Configuration
@EnableJms
public class AppConfig {
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
DefaultJmsListenerContainerFactory factory =
new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(connectionFactory());
factory.setDestinationResolver(destinationResolver());
factory.setConcurrency("3-10");
By default, the infrastructure looks for a bean named jmsListenerContainerFactory
as the source for the factory to use to create message listener containers. In this
case, and ignoring the JMS infrastructure setup, the processOrder method can be
invoked with a core poll size of 3 threads and a maximum pool size of 10 threads.
It is possible to customize the listener container factory to use per annotation or
an explicit default can be configured by implementing the JmsListenerConfigurer
interface. The default is only required if at least one endpoint is registered
without a specific container factory. See the javadoc for full details and examples.
If you prefer
use the &jms:annotation-driven&
id="jmsListenerContainerFactory"
class="org.springframework.jms.config.DefaultJmsListenerContainerFactory"
name="connectionFactory" ref="connectionFactory"
name="destinationResolver" ref="destinationResolver"
name="concurrency" value="3-10"
24.6.2&Programmatic endpoints registration
JmsListenerEndpoint provides a model of an JMS endpoint and is responsible for configuring
the container for that model. The infrastructure allows you to configure endpoints
programmatically in addition to the ones that are detected by the JmsListener annotation.
@Configuration
@EnableJms
public class AppConfig implements JmsListenerConfigurer {
public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) {
SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();
endpoint.setId("myJmsEndpoint");
endpoint.setDestination("anotherQueue");
endpoint.setMessageListener(message -& {
registrar.registerEndpoint(endpoint);
In the example above, we used SimpleJmsListenerEndpoint which provides the actual
MessageListener to invoke but you could just as well build your own endpoint variant
describing a custom invocation mechanism.
It should be noted that you could just as well skip the use of @JmsListener altogether
and only register your endpoints programmatically through JmsListenerConfigurer.
24.6.3&Annotated endpoint method signature
So far, we have been injecting a simple String in our endpoint but it can actually
have a very flexible method signature. Let’s rewrite it to inject the Order with
a custom header:
@Component
public class MyService {
@JmsListener(destination = "myDestination")
public void processOrder(Order order, @Header("order_type") String orderType) {
These are the main elements you can inject in JMS listener endpoints:
The raw javax.jms.Message or any of its subclasses (provided of course that it
matches the incoming message type).
The javax.jms.Session for optional access to the native JMS API e.g. for sending
a custom reply.
The org.springframework.messaging.Message representing the incoming JMS message.
Note that this message holds both the custom and the standard headers (as defined
by JmsHeaders).
@Header-annotated method arguments to extract a specific header value, including
standard JMS headers.
@Headers-annotated argument that must also be assignable to java.util.Map for
getting access to all headers.
A non-annotated element that is not one of the supported types (i.e. Message and
Session) is considered to be the payload. You can make that explicit by annotating
the parameter with @Payload. You can also turn on validation by adding an extra
The ability to inject Spring’s Message abstraction is particularly useful to benefit
from all the information stored in the transport-specific message without relying on
transport-specific API.
@JmsListener(destination = "myDestination")
public void processOrder(Message&Order& order) { ... }
Handling of method arguments is provided by DefaultMessageHandlerMethodFactory which can be
further customized to support additional method arguments. The conversion and validation
support can be customized there as well.
For instance, if we want to make sure our Order is valid before processing it, we can
annotate the payload with @Valid and configure the necessary validator as follows:
@Configuration
@EnableJms
public class AppConfig implements JmsListenerConfigurer {
public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) {
registrar.setMessageHandlerMethodFactory(myJmsHandlerMethodFactory());
public DefaultMessageHandlerMethodFactory myHandlerMethodFactory() {
DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory();
factory.setValidator(myValidator());
24.6.4&Reply management
The existing support in
already allows your method to have a non-void return type. When that’s the case, the result of
the invocation is encapsulated in a javax.jms.Message sent either in the destination specified
in the JMSReplyTo header of the original message or in the default destination configured on
the listener. That default destination can now be set using the @SendTo annotation of the
messaging abstraction.
Assuming our processOrder method should now return an OrderStatus, it is possible to write it
as follow to automatically send a reply:
@JmsListener(destination = "myDestination")
@SendTo("status")
public OrderStatus processOrder(Order order) {
If you need to set additional headers in a transport-independent manner, you could return a
Message instead, something like:
@JmsListener(destination = "myDestination")
@SendTo("status")
public Message&OrderStatus& processOrder(Order order) {
return MessageBuilder
.withPayload(status)
.setHeader("code", 1234)
24.7&JMS Namespace Support
Spring provides an XML namespace for simplifying JMS configuration. To use the JMS
namespace elements you will need to reference the JMS schema:
&?xml version="1.0" encoding="UTF-8"?&
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jms="http://www.springframework.org/schema/jms"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms.xsd"&
The namespace consists of three top-level elements: &annotation-driven/&, &listener-container/&
and &jca-listener-container/&. &annotation-driven enables the use of . &listener-container/& and &jca-listener-container/&
defines shared listener container configuration and may contain &listener/& child elements. Here
is an example of a basic configuration for two listeners.
destination="queue.orders" ref="orderService" method="placeOrder"
destination="queue.confirmations" ref="confirmationLogger" method="log"
The example above is equivalent to creating two distinct listener container bean
definitions and two distinct MessageListenerAdapter bean definitions as demonstrated
in . In addition to the attributes shown
above, the listener element may contain several optional ones. The following table
describes all available attributes:
Table&24.1.&Attributes of the JMS &listener& element
<table summary="Attributes of the JMS AttributeDescriptionidA bean name for the hosting listener container. If not specified, a bean name will be
automatically generated.destination (required)The destination name for this listener, resolved through the DestinationResolver
strategy.ref (required)The bean name of the handler object.methodThe name of the handler method to invoke. If the ref points to a MessageListener
or Spring SessionAwareMessageListener, this attribute may be omitted.response-destinationThe name of the default response destination to send response messages to. This will
be applied in case of a request message that does not carry a "JMSReplyTo" field. The
type of this destination will be determined by the listener-container&#8217;s
"destination-type" attribute. Note: This only applies to a listener method with a
return value, for which each result object will be converted into a response message.subscriptionThe name of the durable subscription, if any.selectorAn optional message selector for this listener.concurrencyThe number of concurrent sessions/consumers to start for this listener. Can either be
a simple number indicating the maximum number (e.g. "5") or a range indicating the lower
as well as the upper limit (e.g. "3-5"). Note that a specified minimum is just a hint
and might be ignored at runtime. Default is the value provided by the container
The &listener-container/& element also accepts several optional attributes. This
allows for customization of the various strategies (for example, taskExecutor and
destinationResolver) as well as basic JMS settings and resource references. Using
these attributes, it is possible to define highly-customized listener containers while
still benefiting from the convenience of the namespace.
Such settings can be automatically exposed as a JmsListenerContainerFactory by
specifying the id of the bean to expose through the factory-id attribute.
connection-factory="myConnectionFactory"
task-executor="myTaskExecutor"
destination-resolver="myDestinationResolver"
transaction-manager="myTransactionManager"
concurrency="10"
destination="queue.orders" ref="orderService" method="placeOrder"
destination="queue.confirmations" ref="confirmationLogger" method="log"
The following table describes all available attributes. Consult the class-level javadocs
of the AbstractMessageListenerContainer and its concrete subclasses for more details
on the individual properties. The javadocs also provide a discussion of transaction
choices and message redelivery scenarios.
Table&24.2.&Attributes of the JMS &listener-container& element
<table summary="Attributes of the JMS AttributeDescriptioncontainer-typeThe type of this listener container. Available options are: default, simple,
default102, or simple102 (the default value is 'default').container-classA custom listener container implementation class as fully qualified class name.
Default is Spring&#8217;s standard DefaultMessageListenerContainer or
SimpleMessageListenerContainer, according to the "container-type" attribute.factory-idExposes the settings defined by this element as a JmsListenerContainerFactory
with the specified id so that they can be reused with other endpoints.connection-factoryA reference to the JMS ConnectionFactory bean (the default bean name is
'connectionFactory').task-executorA reference to the Spring TaskExecutor for the JMS listener invokers.destination-resolverA reference to the DestinationResolver strategy for resolving JMS Destinations.message-converterA reference to the MessageConverter strategy for converting JMS Messages to listener
method arguments. Default is a SimpleMessageConverter.error-handlerA reference to an ErrorHandler strategy for handling any uncaught Exceptions that
may occur during the execution of the MessageListener.destination-typeThe JMS destination type for this listener: queue, topic, durableTopic, sharedTopic
or sharedDurableTopic. This enables potentially the pubSubDomain, subscriptionDurable
and subscriptionShared properties of the container. The default is queue (i.e. disabling
those 3 properties).client-idThe JMS client id for this listener container. Needs to be specified when using
durable subscriptions.cacheThe cache level for JMS resources: none, connection, session, consumer or
auto. By default ( auto), the cache level will effectively be "consumer", unless
an external transaction manager has been specified - in which case the effective
default will be none (assuming Java EE-style transaction management where the given
ConnectionFactory is an XA-aware pool).acknowledgeThe native JMS acknowledge mode: auto, client, dups-ok or transacted. A value
of transacted activates a locally transacted Session. As an alternative, specify
the transaction-manager attribute described below. Default is auto.transaction-managerA reference to an external PlatformTransactionManager (typically an XA-based
transaction coordinator, e.g. Spring&#8217;s JtaTransactionManager). If not specified,
native acknowledging will be used (see "acknowledge" attribute).concurrencyThe number of concurrent sessions/consumers to start for each listener. Can either be
a simple number indicating the maximum number (e.g. "5") or a range indicating the
lower as well as the upper limit (e.g. "3-5"). Note that a specified minimum is just a
hint and might be ignored at runtime. Default is 1; keep concurrency limited to 1 in
case of a topic listener or if queue o consider raising it for
general queues.prefetchThe maximum number of messages to load into a single session. Note that raising this
number might lead to starvation of concurrent consumers!receive-timeoutThe timeout to use for receive calls (in milliseconds). The default is 1000 ms (1
sec); -1 indicates no timeout at all.back-offSpecify the BackOff instance to use to compute the interval between recovery
attempts. If the BackOffExecution implementation returns BackOffExecution#STOP,
the listener container will not further attempt to recover. The recovery-interval
value is ignored when this property is set. The default is a FixedBackOff with
an interval of 5000 ms, that is 5 seconds.recovery-intervalSpecify the interval between recovery attempts, in milliseconds. Convenience
way to create a FixedBackOff with the specified interval. For more recovery
options, consider specifying a BackOff instance instead. The default is 5000 ms,
that is 5 seconds.phaseThe lifecycle phase within which this container should start and stop. The lower the
value the earlier this container will start and the later it will stop. The default is
Integer.MAX_VALUE meaning the container will start as late as possible and stop as
soon as possible.
Configuring a JCA-based listener container with the "jms" schema support is very similar.
resource-adapter="myResourceAdapter"
destination-resolver="myDestinationResolver"
transaction-manager="myTransactionManager"
concurrency="10"
destination="queue.orders" ref="myMessageListener"
The available configuration options for the JCA variant are described in the following
Table&24.3.&Attributes of the JMS &jca-listener-container/& element
<table summary="Attributes of the JMS AttributeDescriptionfactory-idExposes the settings defined by this element as a JmsListenerContainerFactory
with the specified id so that they can be reused with other endpoints.resource-adapterA reference to the JCA ResourceAdapter bean (the default bean name is
'resourceAdapter').activation-spec-factoryA reference to the JmsActivationSpecFactory. The default is to autodetect the JMS
provider and its ActivationSpec class (see DefaultJmsActivationSpecFactory)destination-resolverA reference to the DestinationResolver strategy for resolving JMS Destinations.message-converterA reference to the MessageConverter strategy for converting JMS Messages to listener
method arguments. Default is a SimpleMessageConverter.destination-typeThe JMS destination type for this listener: queue, topic, durableTopic, sharedTopic
or sharedDurableTopic. This enables potentially the pubSubDomain, subscriptionDurable
and subscriptionShared properties of the container. The default is queue (i.e. disabling
those 3 properties).client-idThe JMS client id for this listener container. Needs to be specified when using
durable subscriptions.acknowledgeThe native JMS acknowledge mode: auto, client, dups-ok or transacted. A value
of transacted activates a locally transacted Session. As an alternative, specify
the transaction-manager attribute described below. Default is auto.transaction-managerA reference to a Spring JtaTransactionManager or a
javax.transaction.TransactionManager for kicking off an XA transaction for each
incoming message. If not specified, native acknowledging will be used (see the
"acknowledge" attribute).concurrencyThe number of concurrent sessions/consumers to start for each listener. Can either be
a simple number indicating the maximum number (e.g. "5") or a range indicating the
lower as well as the upper limit (e.g. "3-5"). Note that a specified minimum is just a
hint and will typically be ignored at runtime when using a JCA listener container.
Default is 1.prefetchThe maximum number of messages to load into a single session. Note that raising this
number might lead to starvation of concurrent consumers!}

我要回帖

更多关于 外盘内盘是什么意思 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信