Modified: websites/production/camel/content/jms.html
==============================================================================
--- websites/production/camel/content/jms.html (original)
+++ websites/production/camel/content/jms.html Mon Jul 16 07:19:57 2012
@@ -81,6 +81,8 @@
 
 <div class="panelMacro"><table class="tipMacro"><colgroup span="1"><col 
span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" 
valign="top"><img align="middle" 
src="https://cwiki.apache.org/confluence/images/icons/emoticons/check.gif"; 
width="16" height="16" alt="" border="0"></td><td colspan="1" 
rowspan="1"><b>Transacted and caching</b><br clear="none">See section 
<em>Transactions and Cache Levels</em> below if you are using transactions with 
<a shape="rect" href="jms.html" title="JMS">JMS</a> as it can impact 
performance.</td></tr></table></div>
 
+<div class="panelMacro"><table class="tipMacro"><colgroup span="1"><col 
span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" 
valign="top"><img align="middle" 
src="https://cwiki.apache.org/confluence/images/icons/emoticons/check.gif"; 
width="16" height="16" alt="" border="0"></td><td colspan="1" 
rowspan="1"><b>Request/Reply over JMS</b><br clear="none">Make sure to read the 
section <em>Request-reply over JMS</em> further below on this page for 
important notes about request/reply, as Camel offers a number of options to 
configure for performance, and clustered environments.</td></tr></table></div>
+
 <p>The JMS component allows messages to be sent to (or consumed from) a <a 
shape="rect" class="external-link" href="http://java.sun.com/products/jms/"; 
rel="nofollow">JMS</a> Queue or Topic. The implementation of the JMS Component 
uses Spring's JMS support for declarative transactions, using Spring's 
<tt>JmsTemplate</tt> for sending and a <tt>MessageListenerContainer</tt> for 
consuming.</p>
 
 <p>Maven users will need to add the following dependency to their 
<tt>pom.xml</tt> for this component:</p>
@@ -177,7 +179,7 @@ In Camel 2.8 onwards, the default settin
 
 <h4><a shape="rect" name="JMS-Mostcommonlyusedoptions"></a>Most commonly used 
options</h4>
 <div class="confluenceTableSmall"><div class="table-wrap">
-<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"> Option </th><th colspan="1" rowspan="1" 
class="confluenceTh"> Default Value </th><th colspan="1" rowspan="1" 
class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>clientId</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Sets the JMS client ID to use. Note that this value, if 
specified, must be unique and can only be used by a single JMS connection 
instance. It is typically only required for durable topic subscriptions. You 
may prefer to use <a shape="rect" class="external-link" 
href="http://activemq.apache.org/virtual-destinations.html";>Virtual Topics</a> 
instead. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>concurrentConsumers</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>1</tt> </td><td colspan="1" rowspan="1" class
 ="confluenceTd"> Specifies the default number of concurrent consumers. 
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>disableReplyTo</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> If 
<tt>true</tt>, a producer will behave like a InOnly exchange with the exception 
that <tt>JMSReplyTo</tt> header is sent out and not be suppressed like in the 
case of <tt>InOnly</tt>. Like <tt>InOnly</tt> the producer will not wait for a 
reply. A consumer with this flag will behave like <tt>InOnly</tt>. This feature 
can be used to bridge <tt>InOut</tt> requests to another queue so that a route 
on the other queue will send it&#180;s response directly back to the original 
<tt>JMSReplyTo</tt>. </td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>durableSubscriptionName</tt> </td><td colspan="1" 
rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" 
rowspan="1" class="c
 onfluenceTd"> The durable subscriber name for specifying durable topic 
subscriptions. The <tt>clientId</tt> option <b>must</b> be configured as well. 
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>maxConcurrentConsumers</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>1</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Specifies the maximum number of concurrent consumers. 
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>preserveMessageQos</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Set to <tt>true</tt>, if you want to send message using 
the QoS settings specified on the message, instead of the QoS settings on the 
JMS endpoint. The following three headers are considered <tt>JMSPriority</tt>, 
<tt>JMSDeliveryMode</tt>, and <tt>JMSExpiration</tt>. You can provide all or 
only some of them. If not provided, Camel will fall back to u
 se the values from the endpoint instead. So, when using this option, the 
headers override the values from the endpoint. The <tt>explicitQosEnabled</tt> 
option, by contrast, will only use options set on the endpoint, and not values 
from the message header. </td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>replyTo</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Provides an explicit ReplyTo destination, which overrides 
any incoming value of <tt>Message.getJMSReplyTo()</tt>. If you do <a 
shape="rect" href="request-reply.html" title="Request Reply">Request Reply</a> 
over JMS then read the section further below for more details. 
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>replyToType</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 
2.9:</b> Allows for explicitly specifying
  which kind of strategy to use for replyTo queues when doing request/reply 
over JMS. Possible values are: <tt>Temporary</tt>, <tt>Shared</tt>, or 
<tt>Exclusive</tt>. By default Camel will use temporary queues. However if 
<tt>replyTo</tt> has been configured, then <tt>Shared</tt> is used by default. 
This option allows you to use exclusive queues instead of shared ones. See 
further below for more details, and especially the notes about the implications 
if running in a clustered environment. </td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"> <tt>requestTimeout</tt> </td><td colspan="1" 
rowspan="1" class="confluenceTd"> <tt>20000</tt> </td><td colspan="1" 
rowspan="1" class="confluenceTd"> <b>Producer only:</b> The timeout for waiting 
for a reply when using the InOut <a shape="rect" href="exchange-pattern.html" 
title="Exchange Pattern">Exchange Pattern</a> (in milliseconds). The default is 
20 seconds. See below in section <em>About time to live</em> for more details.
  See also the <em>requestTimeoutCheckerInterval</em> option. </td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"> <tt>selector</tt> </td><td 
colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td 
colspan="1" rowspan="1" class="confluenceTd"> Sets the JMS Selector, which is 
an SQL 92 predicate that is used to filter messages within the broker. You may 
have to encode special characters such as = as %3D <b>Before Camel 2.3.0</b>, 
we don't support this option in CamelConsumerTemplate </td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"> <tt>timeToLive</tt> </td><td 
colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td 
colspan="1" rowspan="1" class="confluenceTd"> When sending messages, specifies 
the time-to-live of the message (in milliseconds). See below in section 
<em>About time to live</em> for more details. </td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"> <tt>transacted</tt> </td><td colspan="1" 
rowspan="1" cla
 ss="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Specifies whether to use transacted mode for 
sending/receiving messages using the InOnly <a shape="rect" 
href="exchange-pattern.html" title="Exchange Pattern">Exchange 
Pattern</a>.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>testConnectionOnStartup</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <b>Camel 2.1:</b> Specifies whether to test the 
connection on startup. This ensures that when Camel starts that all the JMS 
consumers have a valid connection to the JMS broker. If a connection cannot be 
granted then Camel throws an exception on startup. This ensures that Camel is 
not started with failed connections. From <b>Camel 2.8</b> onwards also the JMS 
producers is tested as well. </td></tr></tbody></table>
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"> Option </th><th colspan="1" rowspan="1" 
class="confluenceTh"> Default Value </th><th colspan="1" rowspan="1" 
class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>clientId</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Sets the JMS client ID to use. Note that this value, if 
specified, must be unique and can only be used by a single JMS connection 
instance. It is typically only required for durable topic subscriptions. You 
may prefer to use <a shape="rect" class="external-link" 
href="http://activemq.apache.org/virtual-destinations.html";>Virtual Topics</a> 
instead. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>concurrentConsumers</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>1</tt> </td><td colspan="1" rowspan="1" class
 ="confluenceTd"> Specifies the default number of concurrent consumers. 
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>disableReplyTo</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> If 
<tt>true</tt>, a producer will behave like a InOnly exchange with the exception 
that <tt>JMSReplyTo</tt> header is sent out and not be suppressed like in the 
case of <tt>InOnly</tt>. Like <tt>InOnly</tt> the producer will not wait for a 
reply. A consumer with this flag will behave like <tt>InOnly</tt>. This feature 
can be used to bridge <tt>InOut</tt> requests to another queue so that a route 
on the other queue will send it&#180;s response directly back to the original 
<tt>JMSReplyTo</tt>. </td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>durableSubscriptionName</tt> </td><td colspan="1" 
rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" 
rowspan="1" class="c
 onfluenceTd"> The durable subscriber name for specifying durable topic 
subscriptions. The <tt>clientId</tt> option <b>must</b> be configured as well. 
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>maxConcurrentConsumers</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>1</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Specifies the maximum number of concurrent consumers. 
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>preserveMessageQos</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Set to <tt>true</tt>, if you want to send message using 
the QoS settings specified on the message, instead of the QoS settings on the 
JMS endpoint. The following three headers are considered <tt>JMSPriority</tt>, 
<tt>JMSDeliveryMode</tt>, and <tt>JMSExpiration</tt>. You can provide all or 
only some of them. If not provided, Camel will fall back to u
 se the values from the endpoint instead. So, when using this option, the 
headers override the values from the endpoint. The <tt>explicitQosEnabled</tt> 
option, by contrast, will only use options set on the endpoint, and not values 
from the message header. </td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>replyTo</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Provides an explicit ReplyTo destination, which overrides 
any incoming value of <tt>Message.getJMSReplyTo()</tt>. If you do <a 
shape="rect" href="request-reply.html" title="Request Reply">Request Reply</a> 
over JMS then <b>make sure</b> to read the section <em>Request-reply over 
JMS</em> further below for more details, and the <tt>replyToType</tt> option as 
well. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>replyToType</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>null</tt> </td><td
  colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.9:</b> Allows for 
explicitly specifying which kind of strategy to use for replyTo queues when 
doing request/reply over JMS. Possible values are: <tt>Temporary</tt>, 
<tt>Shared</tt>, or <tt>Exclusive</tt>. By default Camel will use temporary 
queues. However if <tt>replyTo</tt> has been configured, then <tt>Shared</tt> 
is used by default. This option allows you to use exclusive queues instead of 
shared ones. See further below for more details, and especially the notes about 
the implications if running in a clustered environment, and the fact that 
<tt>Shared</tt> reply queues has lower performance than its alternatives 
<tt>Temporary</tt> and <tt>Exclusive</tt>. </td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"> <tt>requestTimeout</tt> </td><td colspan="1" 
rowspan="1" class="confluenceTd"> <tt>20000</tt> </td><td colspan="1" 
rowspan="1" class="confluenceTd"> <b>Producer only:</b> The timeout for waiting 
for a
  reply when using the InOut <a shape="rect" href="exchange-pattern.html" 
title="Exchange Pattern">Exchange Pattern</a> (in milliseconds). The default is 
20 seconds. See below in section <em>About time to live</em> for more details. 
See also the <em>requestTimeoutCheckerInterval</em> option. </td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"> <tt>selector</tt> </td><td 
colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td 
colspan="1" rowspan="1" class="confluenceTd"> Sets the JMS Selector, which is 
an SQL 92 predicate that is used to filter messages within the broker. You may 
have to encode special characters such as = as %3D <b>Before Camel 2.3.0</b>, 
we don't support this option in CamelConsumerTemplate </td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"> <tt>timeToLive</tt> </td><td 
colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td 
colspan="1" rowspan="1" class="confluenceTd"> When sending messages, specifies 
the tim
 e-to-live of the message (in milliseconds). See below in section <em>About 
time to live</em> for more details. </td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>transacted</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Specifies whether to use transacted mode for 
sending/receiving messages using the InOnly <a shape="rect" 
href="exchange-pattern.html" title="Exchange Pattern">Exchange 
Pattern</a>.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>testConnectionOnStartup</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> <b>Camel 2.1:</b> Specifies whether to test the 
connection on startup. This ensures that when Camel starts that all the JMS 
consumers have a valid connection to the JMS broker. If a connection cannot be 
granted then Camel throws an exception on startup. This ensures 
 that Camel is not started with failed connections. From <b>Camel 2.8</b> 
onwards also the JMS producers is tested as well. </td></tr></tbody></table>
 </div>
 
 
@@ -419,8 +421,16 @@ from(<span class="code-quote">"jms:SomeQ
 
 <h3><a shape="rect" name="JMS-RequestreplyoverJMS"></a>Request-reply over 
JMS</h3>
 
-<p>Camel supports <a shape="rect" href="request-reply.html" title="Request 
Reply">Request Reply</a> over JMS. In essence the MEP of the Exchange should be 
<tt>InOut</tt> when you send a message to a JMS queue.<br clear="none">
-The <tt>JmsProducer</tt> detects the <tt>InOut</tt> and provides a 
<tt>JMSReplyTo</tt> header with the reply destination to be used. By default 
Camel uses a temporary queue, but you can use the <tt>replyTo</tt> option on 
the endpoint to specify a fixed reply queue (see more below about fixed reply 
queue). </p>
+<p>Camel supports <a shape="rect" href="request-reply.html" title="Request 
Reply">Request Reply</a> over JMS. In essence the MEP of the Exchange should be 
<tt>InOut</tt> when you send a message to a JMS queue.</p>
+
+<p>Camel offers a number of options to configure request/reply over JMS that 
influence performance and clustered environments. The table below summaries the 
options.</p>
+
+<div class="confluenceTableSmall"><div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"> Option </th><th colspan="1" rowspan="1" 
class="confluenceTh"> Performance </th><th colspan="1" rowspan="1" 
class="confluenceTh"> Cluster </th><th colspan="1" rowspan="1" 
class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>Temporary</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Fast </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Yes </td><td colspan="1" rowspan="1" 
class="confluenceTd"> A temporary queue is used as reply queue, and automatic 
created by Camel. To use this do <b>not</b> specify a replyTo queue name. And 
you can optionally configure <tt>replyToType=Temporary</tt> to make it stand 
out that temporary queues are in use. </td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"> <tt>Shared</tt> </td><td colspan="1" rowspan="1" 
class="confluenceTd"> Slow </td><td colspan="1" rowspan="1" class="conflue
 nceTd"> Yes </td><td colspan="1" rowspan="1" class="confluenceTd"> A shared 
persistent queue is used as reply queue. The queue must be created beforehand, 
although some brokers can create them on the fly such as Apache ActiveMQ. To 
use this you must specify the replyTo queue name. And you can optionally 
configure <tt>replyToType=Shared</tt> to make it stand out that shared queues 
are in use. A shared queue can be used in a clustered environment with multiple 
nodes running this Camel application at the same time. All using the same 
shared reply queue. This is possible because JMS Message selectors are used to 
correlate expected reply messages; this impacts performance though. JMS Message 
selectors is slower, and therefore not as fast as <tt>Temporary</tt> or 
<tt>Exclusive</tt> queues. See further below how to tweak this for better 
performance. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> 
<tt>Exclusive</tt> </td><td colspan="1" rowspan="1" class="confluenceT
 d"> Fast </td><td colspan="1" rowspan="1" class="confluenceTd"> No </td><td 
colspan="1" rowspan="1" class="confluenceTd"> An exclusive persistent queue is 
used as reply queue. The queue must be created beforehand, although some 
brokers can create them on the fly such as Apache ActiveMQ. To use this you 
must specify the replyTo queue name. And you <b>must</b> configure 
<tt>replyToType=Exclusive</tt> to instruct Camel to use exclusive queues, as 
<tt>Shared</tt> is used by default, if a <tt>replyTo</tt> queue name was 
configured. When using exclusive reply queues, then JMS Message selectors are 
<b>not</b> in use, and therefore other applications must not use this queue as 
well. An exclusive queue <b>cannot</b> be used in a clustered environment with 
multiple nodes running this Camel application at the same time; as we do not 
have control if the reply queue comes back to the same node that sent the 
request message; that is why shared queues use JMS Message selectors to make 
sure
  of this. </td></tr></tbody></table>
+</div>
+</div>
+
+<p>The <tt>JmsProducer</tt> detects the <tt>InOut</tt> and provides a 
<tt>JMSReplyTo</tt> header with the reply destination to be used. By default 
Camel uses a temporary queue, but you can use the <tt>replyTo</tt> option on 
the endpoint to specify a fixed reply queue (see more below about fixed reply 
queue). </p>
 
 <p>Camel will automatic setup a consumer which listen on the reply queue, so 
you should <b>not</b> do anything.<br clear="none">
 This consumer is a Spring <tt>DefaultMessageListenerContainer</tt> which 
listen for replies. However it's fixed to 1 concurrent consumer.<br 
clear="none">


Reply via email to