blob: b27297c178f3944449e3595813c89beb087c9723 [file] [log] [blame]
<div class="wiki-content maincontent"><h2 id="StompURIConfiguration-ConfiguringNMS.Stomp">Configuring NMS.Stomp</h2>
<p>All configuration is achieved via URI-encoded parameters, either on the connection or destinations. Through the URIs, you can configure virtually every facet of your NMS.Stomp client. The tables below show the comprehensive set of parameters.</p>
<h3 id="StompURIConfiguration-ConnectionURIParameters"><strong>Connection URI Parameters</strong></h3>
<h5 id="StompURIConfiguration-ExampleConfiguration">&#160;Example Configuration</h5>
<p>Using the Generic NMSConnectionFactory class would look as follows:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>var cf = new NMSConnectionFactory(
"stomp:tcp://localhost:61613");
</pre>
</div></div>
<p>You can also use the Stomp ConecctionFactory implementation directory:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>var cf = new Apache.NMS.Stomp.ConnectionFactory(
"tcp://localhost:61613");
</pre>
</div></div>
<h3 id="StompURIConfiguration-ProtocolOptions">Protocol Options</h3>
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Option Name <br clear="none" class="atl-forced-newline"> </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> tcp </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Uses TCP/IP Sockets to connect to the Broker. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> ssl </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Uses TCP/IP Sockets to connect to the Broker with an added SSL layer (Not available on .NETCF). </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> failover </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Uses the Failover Transport to connect and reconnect to one or more Brokers </p></td></tr></tbody></table></div>
<p>You can add the failover option using the Generic NMSConnectionFactory class like this:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>var cf = new NMSConnectionFactory(
"stomp:failover:tcp://localhost:61613");
</pre>
</div></div>
<p>You can also use the Stomp ConecctionFactory implementation directory:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>var cf = new Apache.NMS.Stomp.ConnectionFactory(
"failover:tcp://localhost:61613");
</pre>
</div></div>
<h4 id="StompURIConfiguration-TransportOptions"><strong>Transport Options</strong></h4>
<h5 id="StompURIConfiguration-TCPTransportOptions"><strong>TCP Transport Options</strong></h5>
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Option Name </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.useLogging </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Log data that is sent across the Transport. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.receiveBufferSize </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 8192 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Amount of Data to buffer from the Socket </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.sendBufferSize </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 8192 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Amount of Data to buffer before writing to the Socket </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.receiveTimeout </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 0 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Time to wait for more data, zero means wait infinitely </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.sendTimeout </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 0 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Timeout on sends, 0 means wait forever for completion </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.requestTimeout </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 0 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Time to wait before a Request Command is considered to have failed </p></td></tr><tr><td></td></tr></tbody></table></div>
<h5 id="StompURIConfiguration-FailoverTransportOptions">Failover Transport Options</h5>
<p>Prior to NMS.Stomp v1.4.0 the failover transport options did not use the transport.* prefix.</p>
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Option Name </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.timeout </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> -1 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Time that a send operation blocks before failing. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.initialReconnectDelay </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 10 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Time in Milliseconds that the transport waits before attempting to reconnect the first time. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.maxReconnectDelay </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 30000 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The max time in Milliseconds that the transport will wait before attempting to reconnect. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.backOffMultiplier </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 2 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The amount by which the reconnect delay will be multiplied by if useExponentialBackOff is enabled. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.useExponentialBackOff </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> true </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Should the delay between connection attempt grow on each try up to the max reconnect delay. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.randomize </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> true </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Should the Uri to connect to be chosen at random from the list of available Uris. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.maxReconnectAttempts </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 0 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Maximum number of time the transport will attempt to reconnect before failing (0 means infinite retries) </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.startupMaxReconnectAttempts </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 0 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Maximum number of time the transport will attempt to reconnect before failing when there has never been a connection made. (0 means infinite retries) <strong>(included in NMS.Stomp v1.5.0+)</strong> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> transport.reconnectDelay </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 10 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The delay in milliseconds that the transport waits before attempting a reconnection. </p></td></tr><tr><td></td></tr></tbody></table></div>
<h4 id="StompURIConfiguration-ConnectionOptions"><strong>Connection Options</strong></h4>
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Option Name </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> connection.AsyncSend </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Are message sent Asynchronously. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> connection.AsyncClose </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> true </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Should the close command be sent Asynchronously </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> connection.AlwaysSyncSend </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Causes all messages a Producer sends to be sent Asynchronously. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> connection.CopyMessageOnSend </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> true </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Copies the Message objects a Producer sends so that the client can reuse Message objects without affecting an in-flight message. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> connection.useCompression </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Should message bodies be compressed before being sent. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> connection.sendAcksAsync </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Should message acks be sent asynchronously </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> connection.messagePrioritySupported </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> true </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Should messages be delivered to the client based on the value of the Message Priority header. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> connection.dispatchAsync </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Should the broker <a shape="rect" class="external-link" href="http://activemq.apache.org/consumer-dispatch-async.html">dispatch messages asynchronously</a> to the connection's consumers. </p></td></tr><tr><td></td></tr></tbody></table></div>
<h5 id="StompURIConfiguration-StompWireProtocolOptions"><strong>Stomp Wire Protocol Options</strong></h5>
<div class="confluence-information-macro confluence-information-macro-information"><p class="title">Be Careful</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">
<p>These values are currently not supported but are planned for a later release.</p></div></div>
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Option Name </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> wireFormat.maxInactivityDuration </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 30000 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The maximum inactivity duration (before which the socket is considered dead) in milliseconds. On some platforms it can take a long time for a socket to appear to die, so we allow the broker to kill connections if they are inactive for a period of time. Use by some transports to enable a keep alive heart beat feature. Set to a value &lt;= 0 to disable inactivity monitoring. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> wireFormat.maxInactivityDurationInitialDelay </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 10000 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The initial delay in starting the maximum inactivity checks (and, yes, the word 'Initial' is supposed to be misspelled like that) </p></td></tr></tbody></table></div>
<h3 id="StompURIConfiguration-DestinationURIParameters"><strong>Destination URI Parameters</strong></h3>
<h5 id="StompURIConfiguration-ExampleConfiguration.1">Example Configuration</h5>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>d = session.CreateTopic("com.foo?consumer.prefetchSize=2000&amp;consumer.noLocal=true");
</pre>
</div></div>
<h4 id="StompURIConfiguration-GeneralOptions"><strong>General Options</strong></h4>
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Option Name </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> consumer.prefetchSize </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 1000 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The number of message the consumer will <a shape="rect" class="external-link" href="http://activemq.apache.org/what-is-the-prefetch-limit-for.html">prefetch</a>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> consumer.noLocal </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Same as the noLocal flag on a Topic consumer. Exposed here so that it can be used with a queue. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> consumer.dispatchAsync </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Should the broker <a shape="rect" class="external-link" href="http://activemq.apache.org/consumer-dispatch-async.html">dispatch messages asynchronously</a> to the consumer. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> consumer.retroactive </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Is this a <a shape="rect" class="external-link" href="http://activemq.apache.org/retroactive-consumer.html">Retroactive Consumer</a>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> consumer.selector </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> null </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> JMS Selector used with the consumer. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> consumer.exclusive </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Is this an <a shape="rect" class="external-link" href="http://activemq.apache.org/exclusive-consumer.html">Exclusive Consumer</a>. </p></td></tr></tbody></table></div></div>