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-2.5.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 The "102" suffix adapts to a JMS provider that implements JMS 1.0.2 only.
43 ]]></xsd:documentation>
46 <xsd:restriction base="xsd:NMTOKEN">
47 <xsd:enumeration value="default"/>
48 <xsd:enumeration value="default102"/>
49 <xsd:enumeration value="simple"/>
50 <xsd:enumeration value="simple102"/>
54 <xsd:attribute name="container-class" type="xsd:string">
56 <xsd:documentation><![CDATA[
57 A custom listener container implementation class as fully qualified class name.
58 Default is Spring's standard DefaultMessageListenerContainer or
59 SimpleMessageListenerContainer, according to the "container-type" attribute.
60 Note that a custom container class will typically be a subclass of either of
61 those two Spring-provided standard container classes: Nake sure that the
62 "container-type" attribute matches the actual base type that the custom class
63 derives from ("default" will usually be fine anyway, since most custom classes
64 will derive from DefaultMessageListenerContainer).
65 ]]></xsd:documentation>
68 <tool:expected-type type="java.lang.Class"/>
69 <tool:assignable-to type="org.springframework.jms.listener.AbstractMessageListenerContainer"/>
74 <xsd:attribute name="connection-factory" type="xsd:string" default="connectionFactory">
76 <xsd:documentation><![CDATA[
77 A reference to the JMS ConnectionFactory bean.
78 Default is "connectionFactory".
79 ]]></xsd:documentation>
81 <tool:annotation kind="ref">
82 <tool:expected-type type="javax.jms.ConnectionFactory"/>
87 <xsd:attribute name="task-executor" type="xsd:string">
89 <xsd:documentation><![CDATA[
90 A reference to the Spring TaskExecutor for the JMS listener invokers.
91 Default is a SimpleAsyncTaskExecutor, using internally managed threads.
92 ]]></xsd:documentation>
94 <tool:annotation kind="ref">
95 <tool:expected-type type="org.springframework.core.task.TaskExecutor"/>
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="destination-type" default="queue">
130 <xsd:documentation><![CDATA[
131 The JMS destination type for this listener: "queue", "topic" or "durableTopic".
132 The default is "queue".
133 ]]></xsd:documentation>
136 <xsd:restriction base="xsd:NMTOKEN">
137 <xsd:enumeration value="queue"/>
138 <xsd:enumeration value="topic"/>
139 <xsd:enumeration value="durableTopic"/>
143 <xsd:attribute name="client-id" type="xsd:string">
145 <xsd:documentation><![CDATA[
146 The JMS client id for this listener container.
147 Needs to be specified when using durable subscriptions.
148 ]]></xsd:documentation>
151 <xsd:attribute name="cache" default="auto">
153 <xsd:documentation><![CDATA[
154 The cache level for JMS resources: "none", "connection", "session", "consumer"
155 or "auto". By default ("auto"), the cache level will effectively be "consumer",
156 unless an external transaction manager has been specified - in which case the
157 effective default will be "none" (assuming J2EE-style transaction management
158 where the given ConnectionFactory is an XA-aware pool).
159 ]]></xsd:documentation>
162 <xsd:restriction base="xsd:NMTOKEN">
163 <xsd:enumeration value="none"/>
164 <xsd:enumeration value="connection"/>
165 <xsd:enumeration value="session"/>
166 <xsd:enumeration value="consumer"/>
167 <xsd:enumeration value="auto"/>
171 <xsd:attribute name="acknowledge" default="auto">
173 <xsd:documentation><![CDATA[
174 The native JMS acknowledge mode: "auto", "client", "dups-ok" or "transacted".
175 A value of "transacted" effectively activates a locally transacted Session;
176 as alternative, specify an external "transaction-manager" via the corresponding
177 attribute. Default is "auto".
178 ]]></xsd:documentation>
181 <xsd:restriction base="xsd:NMTOKEN">
182 <xsd:enumeration value="auto"/>
183 <xsd:enumeration value="client"/>
184 <xsd:enumeration value="dups-ok"/>
185 <xsd:enumeration value="transacted"/>
189 <xsd:attribute name="transaction-manager" type="xsd:string">
191 <xsd:documentation><![CDATA[
192 A reference to an external PlatformTransactionManager (typically an
193 XA-based transaction coordinator, e.g. Spring's JtaTransactionManager).
194 If not specified, native acknowledging will be used (see "acknowledge" attribute).
195 ]]></xsd:documentation>
197 <tool:annotation kind="ref">
198 <tool:expected-type type="org.springframework.transaction.PlatformTransactionManager"/>
203 <xsd:attribute name="concurrency" type="xsd:string">
205 <xsd:documentation><![CDATA[
206 The number of concurrent sessions/consumers to start for each listener.
207 Can either be a simple number indicating the maximum number (e.g. "5")
208 or a range indicating the lower as well as the upper limit (e.g. "3-5").
209 Note that a specified minimum is just a hint and might be ignored at runtime.
210 Default is 1; keep concurrency limited to 1 in case of a topic listener
211 or if message ordering is important; consider raising it for general queues.
212 ]]></xsd:documentation>
215 <xsd:attribute name="prefetch" type="xsd:int">
217 <xsd:documentation><![CDATA[
218 The maximum number of messages to load into a single session.
219 Note that raising this number might lead to starvation of concurrent consumers!
220 ]]></xsd:documentation>
226 <xsd:element name="jca-listener-container">
228 <xsd:documentation><![CDATA[
229 Each listener child element will be hosted by a container whose configuration
230 is determined by this parent element. This variant builds standard JCA-based
231 listener containers, operating against a specified JCA ResourceAdapter
232 (which needs to be provided by the JMS message broker, e.g. ActiveMQ).
233 ]]></xsd:documentation>
236 <tool:exports type="org.springframework.jms.listener.endpoint.JmsMessageEndpointManager"/>
242 <xsd:element name="listener" type="listenerType" minOccurs="0" maxOccurs="unbounded"/>
244 <xsd:attribute name="resource-adapter" type="xsd:string" default="resourceAdapter">
246 <xsd:documentation><![CDATA[
247 A reference to the JCA ResourceAdapter bean for the JMS provider.
248 Default is "resourceAdapter".
249 ]]></xsd:documentation>
251 <tool:annotation kind="ref">
252 <tool:expected-type type="javax.resource.spi.ResourceAdapter"/>
257 <xsd:attribute name="activation-spec-factory" type="xsd:string">
259 <xsd:documentation><![CDATA[
260 A reference to the JmsActivationSpecFactory.
261 Default is to autodetect the JMS provider and its ActivationSpec class
262 (see DefaultJmsActivationSpecFactory).
263 ]]></xsd:documentation>
265 <tool:annotation kind="ref">
266 <tool:expected-type type="org.springframework.jms.listener.endpoint.JmsActivationSpecFactory"/>
271 <xsd:attribute name="destination-resolver" type="xsd:string">
273 <xsd:documentation><![CDATA[
274 A reference to the DestinationResolver strategy for resolving destination names.
275 Default is to pass in the destination name Strings into the JCA ActivationSpec as-is.
276 Alternatively, specify a reference to a JndiDestinationResolver (typically in a J2EE
277 environment, in particular if the server insists on receiving Destination objects).
278 ]]></xsd:documentation>
280 <tool:annotation kind="ref">
281 <tool:expected-type type="org.springframework.jms.support.destination.DestinationResolver"/>
286 <xsd:attribute name="message-converter" type="xsd:string">
288 <xsd:documentation><![CDATA[
289 A reference to the MessageConverter strategy for converting JMS Messages to
290 listener method arguments. Default is a SimpleMessageConverter.
291 ]]></xsd:documentation>
293 <tool:annotation kind="ref">
294 <tool:expected-type type="org.springframework.jms.support.converter.MessageConverter"/>
299 <xsd:attribute name="destination-type" default="queue">
301 <xsd:documentation><![CDATA[
302 The JMS destination type for this listener: "queue", "topic" or "durableTopic".
304 ]]></xsd:documentation>
307 <xsd:restriction base="xsd:NMTOKEN">
308 <xsd:enumeration value="queue"/>
309 <xsd:enumeration value="topic"/>
310 <xsd:enumeration value="durableTopic"/>
314 <xsd:attribute name="client-id" type="xsd:string">
316 <xsd:documentation><![CDATA[
317 The JMS client id for this listener container.
318 Needs to be specified when using durable subscriptions.
319 ]]></xsd:documentation>
322 <xsd:attribute name="acknowledge" default="auto">
324 <xsd:documentation><![CDATA[
325 The native JMS acknowledge mode: "auto", "client", "dups-ok" or "transacted".
326 A value of "transacted" effectively activates a locally transacted Session;
327 as alternative, specify an external "transaction-manager" via the corresponding
328 attribute. Default is "auto".
329 ]]></xsd:documentation>
332 <xsd:restriction base="xsd:NMTOKEN">
333 <xsd:enumeration value="auto"/>
334 <xsd:enumeration value="client"/>
335 <xsd:enumeration value="dups-ok"/>
336 <xsd:enumeration value="transacted"/>
340 <xsd:attribute name="transaction-manager" type="xsd:string">
342 <xsd:documentation><![CDATA[
343 A reference to the Spring JtaTransactionManager or [javax.transaction.TransactionManager],
344 for kicking off an XA transaction for each incoming message.
345 If not specified, native acknowledging will be used (see "acknowledge" attribute).
346 ]]></xsd:documentation>
348 <tool:annotation kind="ref"/>
352 <xsd:attribute name="concurrency" type="xsd:string">
354 <xsd:documentation><![CDATA[
355 The number of concurrent sessions/consumers to start for each listener.
356 Can either be a simple number indicating the maximum number (e.g. "5")
357 or a range indicating the lower as well as the upper limit (e.g. "3-5").
358 Note that a specified minimum is just a hint and will typically be ignored
359 at runtime when using a JCA listener container. Default is 1.
360 ]]></xsd:documentation>
363 <xsd:attribute name="prefetch" type="xsd:int">
365 <xsd:documentation><![CDATA[
366 The maximum number of messages to load into a single session.
367 Note that raising this number might lead to starvation of concurrent consumers!
368 ]]></xsd:documentation>
374 <xsd:complexType name="listenerType">
375 <xsd:attribute name="id" type="xsd:ID">
377 <xsd:documentation><![CDATA[
378 The unique identifier for a listener.
379 ]]></xsd:documentation>
382 <xsd:attribute name="destination" type="xsd:string" use="required">
384 <xsd:documentation><![CDATA[
385 The destination name for this listener, resolved through the
386 container-wide DestinationResolver strategy (if any). Required.
387 ]]></xsd:documentation>
390 <xsd:attribute name="subscription" type="xsd:string">
392 <xsd:documentation><![CDATA[
393 The name for the durable subscription, if any.
394 ]]></xsd:documentation>
397 <xsd:attribute name="selector" type="xsd:string">
399 <xsd:documentation><![CDATA[
400 The JMS message selector for this listener.
401 ]]></xsd:documentation>
404 <xsd:attribute name="ref" type="xsd:string" use="required">
406 <xsd:documentation><![CDATA[
407 The bean name of the listener object, implementing
408 the MessageListener/SessionAwareMessageListener interface
409 or defining the specified listener method. Required.
410 ]]></xsd:documentation>
412 <tool:annotation kind="ref"/>
416 <xsd:attribute name="method" type="xsd:string">
418 <xsd:documentation><![CDATA[
419 The name of the listener method to invoke. If not specified,
420 the target bean is supposed to implement the MessageListener
421 or SessionAwareMessageListener interface.
422 ]]></xsd:documentation>
425 <xsd:attribute name="response-destination" type="xsd:string">
427 <xsd:documentation><![CDATA[
428 The name of the default response destination to send response messages to.
429 This will be applied in case of a request message that does not carry
430 a "JMSReplyTo" field. The type of this destination will be determined
431 by the listener-container's "destination-type" attribute.
432 Note: This only applies to a listener method with a return value,
433 for which each result object will be converted into a response message.
434 ]]></xsd:documentation>