1 <?xml version="1.0" encoding="UTF-8"?>
3 <xsd:schema xmlns="http://www.springframework.org/schema/jms"
4 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
5 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6 xmlns:tool="http://www.springframework.org/schema/tool"
7 targetNamespace="http://www.springframework.org/schema/jms"
8 elementFormDefault="qualified"
9 attributeFormDefault="unqualified">
11 <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.0.xsd"/>
14 <xsd:documentation><![CDATA[
15 Defines the configuration elements for the Spring Framework's JMS support.
16 Allows for configuring JMS listener containers in XML 'shortcut' style.
17 ]]></xsd:documentation>
20 <xsd:element name="listener-container">
22 <xsd:documentation><![CDATA[
23 Each listener child element will be hosted by a container whose configuration
24 is determined by this parent element. This variant builds standard JMS
25 listener containers, operating against a specified JMS ConnectionFactory.
26 ]]></xsd:documentation>
29 <tool:exports type="org.springframework.jms.listener.AbstractMessageListenerContainer"/>
35 <xsd:element name="listener" type="listenerType" minOccurs="0" maxOccurs="unbounded"/>
37 <xsd:attribute name="container-type" default="default">
39 <xsd:documentation><![CDATA[
40 The type of this listener container: "default" or "simple", choosing
41 between DefaultMessageListenerContainer and SimpleMessageListenerContainer.
42 ]]></xsd:documentation>
45 <xsd:restriction base="xsd:NMTOKEN">
46 <xsd:enumeration value="default"/>
47 <xsd:enumeration value="simple"/>
51 <xsd:attribute name="container-class" type="xsd:string">
53 <xsd:documentation><![CDATA[
54 A custom listener container implementation class as fully qualified class name.
55 Default is Spring's standard DefaultMessageListenerContainer or
56 SimpleMessageListenerContainer, according to the "container-type" attribute.
57 Note that a custom container class will typically be a subclass of either of
58 those two Spring-provided standard container classes: Nake sure that the
59 "container-type" attribute matches the actual base type that the custom class
60 derives from ("default" will usually be fine anyway, since most custom classes
61 will derive from DefaultMessageListenerContainer).
62 ]]></xsd:documentation>
65 <tool:expected-type type="java.lang.Class"/>
66 <tool:assignable-to type="org.springframework.jms.listener.AbstractMessageListenerContainer"/>
71 <xsd:attribute name="connection-factory" type="xsd:string" default="connectionFactory">
73 <xsd:documentation><![CDATA[
74 A reference to the JMS ConnectionFactory bean.
75 Default is "connectionFactory".
76 ]]></xsd:documentation>
78 <tool:annotation kind="ref">
79 <tool:expected-type type="javax.jms.ConnectionFactory"/>
84 <xsd:attribute name="task-executor" type="xsd:string">
86 <xsd:documentation><![CDATA[
87 A reference to a Spring TaskExecutor (or standard JDK 1.5 Executor) for executing
88 JMS listener invokers. Default is a SimpleAsyncTaskExecutor in case of a
89 DefaultMessageListenerContainer, using internally managed threads. For a
90 SimpleMessageListenerContainer, listeners will always get invoked within the
91 JMS provider's receive thread by default.
92 ]]></xsd:documentation>
94 <tool:annotation kind="ref">
95 <tool:expected-type type="java.util.concurrent.Executor"/>
100 <xsd:attribute name="destination-resolver" type="xsd:string">
102 <xsd:documentation><![CDATA[
103 A reference to the DestinationResolver strategy for resolving destination names.
104 Default is a DynamicDestinationResolver, using the JMS provider's queue/topic
105 name resolution. Alternatively, specify a reference to a JndiDestinationResolver
106 (typically in a J2EE environment).
107 ]]></xsd:documentation>
109 <tool:annotation kind="ref">
110 <tool:expected-type type="org.springframework.jms.support.destination.DestinationResolver"/>
115 <xsd:attribute name="message-converter" type="xsd:string">
117 <xsd:documentation><![CDATA[
118 A reference to the MessageConverter strategy for converting JMS Messages to
119 listener method arguments. Default is a SimpleMessageConverter.
120 ]]></xsd:documentation>
122 <tool:annotation kind="ref">
123 <tool:expected-type type="org.springframework.jms.support.converter.MessageConverter"/>
128 <xsd:attribute name="error-handler" type="xsd:string">
130 <xsd:documentation><![CDATA[
131 A reference to an ErrorHandler strategy for handling any uncaught Exceptions
132 that may occur during the execution of the MessageListener.
133 ]]></xsd:documentation>
135 <tool:annotation kind="ref">
136 <tool:expected-type type="org.springframework.util.ErrorHandler"/>
141 <xsd:attribute name="destination-type" default="queue">
143 <xsd:documentation><![CDATA[
144 The JMS destination type for this listener: "queue", "topic" or "durableTopic".
145 The default is "queue".
146 ]]></xsd:documentation>
149 <xsd:restriction base="xsd:NMTOKEN">
150 <xsd:enumeration value="queue"/>
151 <xsd:enumeration value="topic"/>
152 <xsd:enumeration value="durableTopic"/>
156 <xsd:attribute name="client-id" type="xsd:string">
158 <xsd:documentation><![CDATA[
159 The JMS client id for this listener container.
160 Needs to be specified when using durable subscriptions.
161 ]]></xsd:documentation>
164 <xsd:attribute name="cache" default="auto">
166 <xsd:documentation><![CDATA[
167 The cache level for JMS resources: "none", "connection", "session", "consumer"
168 or "auto". By default ("auto"), the cache level will effectively be "consumer",
169 unless an external transaction manager has been specified - in which case the
170 effective default will be "none" (assuming J2EE-style transaction management
171 where the given ConnectionFactory is an XA-aware pool).
172 ]]></xsd:documentation>
175 <xsd:restriction base="xsd:NMTOKEN">
176 <xsd:enumeration value="none"/>
177 <xsd:enumeration value="connection"/>
178 <xsd:enumeration value="session"/>
179 <xsd:enumeration value="consumer"/>
180 <xsd:enumeration value="auto"/>
184 <xsd:attribute name="acknowledge" default="auto">
186 <xsd:documentation><![CDATA[
187 The native JMS acknowledge mode: "auto", "client", "dups-ok" or "transacted".
188 A value of "transacted" effectively activates a locally transacted Session;
189 as alternative, specify an external "transaction-manager" via the corresponding
190 attribute. Default is "auto".
191 ]]></xsd:documentation>
194 <xsd:restriction base="xsd:NMTOKEN">
195 <xsd:enumeration value="auto"/>
196 <xsd:enumeration value="client"/>
197 <xsd:enumeration value="dups-ok"/>
198 <xsd:enumeration value="transacted"/>
202 <xsd:attribute name="transaction-manager" type="xsd:string">
204 <xsd:documentation><![CDATA[
205 A reference to an external PlatformTransactionManager (typically an
206 XA-based transaction coordinator, e.g. Spring's JtaTransactionManager).
207 If not specified, native acknowledging will be used (see "acknowledge" attribute).
208 ]]></xsd:documentation>
210 <tool:annotation kind="ref">
211 <tool:expected-type type="org.springframework.transaction.PlatformTransactionManager"/>
216 <xsd:attribute name="concurrency" type="xsd:string">
218 <xsd:documentation><![CDATA[
219 The number of concurrent sessions/consumers to start for each listener.
220 Can either be a simple number indicating the maximum number (e.g. "5")
221 or a range indicating the lower as well as the upper limit (e.g. "3-5").
222 Note that a specified minimum is just a hint and might be ignored at runtime.
223 Default is 1; keep concurrency limited to 1 in case of a topic listener
224 or if message ordering is important; consider raising it for general queues.
225 ]]></xsd:documentation>
228 <xsd:attribute name="prefetch" type="xsd:int">
230 <xsd:documentation><![CDATA[
231 The maximum number of messages to load into a single session.
232 Note that raising this number might lead to starvation of concurrent consumers!
233 ]]></xsd:documentation>
236 <xsd:attribute name="phase" type="xsd:string">
238 <xsd:documentation><![CDATA[
239 The lifecycle phase within which this container should start and stop. The lower
240 the value the earlier this container will start and the later it will stop. The
241 default is Integer.MAX_VALUE meaning the container will start as late as possible
242 and stop as soon as possible.
243 ]]></xsd:documentation>
249 <xsd:element name="jca-listener-container">
251 <xsd:documentation><![CDATA[
252 Each listener child element will be hosted by a container whose configuration
253 is determined by this parent element. This variant builds standard JCA-based
254 listener containers, operating against a specified JCA ResourceAdapter
255 (which needs to be provided by the JMS message broker, e.g. ActiveMQ).
256 ]]></xsd:documentation>
259 <tool:exports type="org.springframework.jms.listener.endpoint.JmsMessageEndpointManager"/>
265 <xsd:element name="listener" type="listenerType" minOccurs="0" maxOccurs="unbounded"/>
267 <xsd:attribute name="resource-adapter" type="xsd:string" default="resourceAdapter">
269 <xsd:documentation><![CDATA[
270 A reference to the JCA ResourceAdapter bean for the JMS provider.
271 Default is "resourceAdapter".
272 ]]></xsd:documentation>
274 <tool:annotation kind="ref">
275 <tool:expected-type type="javax.resource.spi.ResourceAdapter"/>
280 <xsd:attribute name="activation-spec-factory" type="xsd:string">
282 <xsd:documentation><![CDATA[
283 A reference to the JmsActivationSpecFactory.
284 Default is to autodetect the JMS provider and its ActivationSpec class
285 (see DefaultJmsActivationSpecFactory).
286 ]]></xsd:documentation>
288 <tool:annotation kind="ref">
289 <tool:expected-type type="org.springframework.jms.listener.endpoint.JmsActivationSpecFactory"/>
294 <xsd:attribute name="destination-resolver" type="xsd:string">
296 <xsd:documentation><![CDATA[
297 A reference to the DestinationResolver strategy for resolving destination names.
298 Default is to pass in the destination name Strings into the JCA ActivationSpec as-is.
299 Alternatively, specify a reference to a JndiDestinationResolver (typically in a J2EE
300 environment, in particular if the server insists on receiving Destination objects).
301 ]]></xsd:documentation>
303 <tool:annotation kind="ref">
304 <tool:expected-type type="org.springframework.jms.support.destination.DestinationResolver"/>
309 <xsd:attribute name="message-converter" type="xsd:string">
311 <xsd:documentation><![CDATA[
312 A reference to the MessageConverter strategy for converting JMS Messages to
313 listener method arguments. Default is a SimpleMessageConverter.
314 ]]></xsd:documentation>
316 <tool:annotation kind="ref">
317 <tool:expected-type type="org.springframework.jms.support.converter.MessageConverter"/>
322 <xsd:attribute name="destination-type" default="queue">
324 <xsd:documentation><![CDATA[
325 The JMS destination type for this listener: "queue", "topic" or "durableTopic".
327 ]]></xsd:documentation>
330 <xsd:restriction base="xsd:NMTOKEN">
331 <xsd:enumeration value="queue"/>
332 <xsd:enumeration value="topic"/>
333 <xsd:enumeration value="durableTopic"/>
337 <xsd:attribute name="client-id" type="xsd:string">
339 <xsd:documentation><![CDATA[
340 The JMS client id for this listener container.
341 Needs to be specified when using durable subscriptions.
342 ]]></xsd:documentation>
345 <xsd:attribute name="acknowledge" default="auto">
347 <xsd:documentation><![CDATA[
348 The native JMS acknowledge mode: "auto", "client", "dups-ok" or "transacted".
349 A value of "transacted" effectively activates a locally transacted Session;
350 as alternative, specify an external "transaction-manager" via the corresponding
351 attribute. Default is "auto".
352 ]]></xsd:documentation>
355 <xsd:restriction base="xsd:NMTOKEN">
356 <xsd:enumeration value="auto"/>
357 <xsd:enumeration value="client"/>
358 <xsd:enumeration value="dups-ok"/>
359 <xsd:enumeration value="transacted"/>
363 <xsd:attribute name="transaction-manager" type="xsd:string">
365 <xsd:documentation><![CDATA[
366 A reference to the Spring JtaTransactionManager or [javax.transaction.TransactionManager],
367 for kicking off an XA transaction for each incoming message.
368 If not specified, native acknowledging will be used (see "acknowledge" attribute).
369 ]]></xsd:documentation>
371 <tool:annotation kind="ref"/>
375 <xsd:attribute name="concurrency" type="xsd:string">
377 <xsd:documentation><![CDATA[
378 The number of concurrent sessions/consumers to start for each listener.
379 Can either be a simple number indicating the maximum number (e.g. "5")
380 or a range indicating the lower as well as the upper limit (e.g. "3-5").
381 Note that a specified minimum is just a hint and will typically be ignored
382 at runtime when using a JCA listener container. Default is 1.
383 ]]></xsd:documentation>
386 <xsd:attribute name="prefetch" type="xsd:int">
388 <xsd:documentation><![CDATA[
389 The maximum number of messages to load into a single session.
390 Note that raising this number might lead to starvation of concurrent consumers!
391 ]]></xsd:documentation>
394 <xsd:attribute name="phase" type="xsd:string">
396 <xsd:documentation><![CDATA[
397 The lifecycle phase within which this container should start and stop. The lower
398 the value the earlier this container will start and the later it will stop. The
399 default is Integer.MAX_VALUE meaning the container will start as late as possible
400 and stop as soon as possible.
401 ]]></xsd:documentation>
407 <xsd:complexType name="listenerType">
408 <xsd:attribute name="id" type="xsd:ID">
410 <xsd:documentation><![CDATA[
411 The unique identifier for a listener.
412 ]]></xsd:documentation>
415 <xsd:attribute name="destination" type="xsd:string" use="required">
417 <xsd:documentation><![CDATA[
418 The destination name for this listener, resolved through the
419 container-wide DestinationResolver strategy (if any). Required.
420 ]]></xsd:documentation>
423 <xsd:attribute name="subscription" type="xsd:string">
425 <xsd:documentation><![CDATA[
426 The name for the durable subscription, if any.
427 ]]></xsd:documentation>
430 <xsd:attribute name="selector" type="xsd:string">
432 <xsd:documentation><![CDATA[
433 The JMS message selector for this listener.
434 ]]></xsd:documentation>
437 <xsd:attribute name="ref" type="xsd:string" use="required">
439 <xsd:documentation><![CDATA[
440 The bean name of the listener object, implementing
441 the MessageListener/SessionAwareMessageListener interface
442 or defining the specified listener method. Required.
443 ]]></xsd:documentation>
445 <tool:annotation kind="ref"/>
449 <xsd:attribute name="method" type="xsd:string">
451 <xsd:documentation><![CDATA[
452 The name of the listener method to invoke. If not specified,
453 the target bean is supposed to implement the MessageListener
454 or SessionAwareMessageListener interface.
455 ]]></xsd:documentation>
458 <xsd:attribute name="response-destination" type="xsd:string">
460 <xsd:documentation><![CDATA[
461 The name of the default response destination to send response messages to.
462 This will be applied in case of a request message that does not carry
463 a "JMSReplyTo" field. The type of this destination will be determined
464 by the listener-container's "destination-type" attribute.
465 Note: This only applies to a listener method with a return value,
466 for which each result object will be converted into a response message.
467 ]]></xsd:documentation>