blob: 9e7f94594c117bf7036cc390a387feb30676b9c2 [file] [log] [blame]
<div class="wiki-content maincontent"><h2>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><strong>Connection URI Parameters</strong></h3>
<h5>&#160;Example Configuration</h5>
<p>Using the Generic NMSConnectionFactory class would look as follows:</p>
<structured-macro ac:macro-id="7e46419e-1c01-4a8a-bbe5-d30cb88303c8" ac:name="noformat" ac:schema-version="1"><plain-text-body>
var cf = new NMSConnectionFactory(
"stomp:tcp://localhost:61613");
</plain-text-body></structured-macro>
<p>You can also use the Stomp ConecctionFactory implementation directory:</p>
<structured-macro ac:macro-id="c3b5e7f5-7d2d-4617-bb72-0dfe2557f130" ac:name="noformat" ac:schema-version="1"><plain-text-body>
var cf = new Apache.NMS.Stomp.ConnectionFactory(
"tcp://localhost:61613");
</plain-text-body></structured-macro>
<h3>Protocol Options</h3>
<table><tbody><tr><th colspan="1" rowspan="1"><p> Option Name <br clear="none" class="atl-forced-newline"> </p></th><th colspan="1" rowspan="1"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1"><p> tcp </p></td><td colspan="1" rowspan="1"><p> Uses TCP/IP Sockets to connect to the Broker. </p></td></tr><tr><td colspan="1" rowspan="1"><p> ssl </p></td><td colspan="1" rowspan="1"><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"><p> failover </p></td><td colspan="1" rowspan="1"><p> Uses the Failover Transport to connect and reconnect to one or more Brokers </p></td></tr></tbody></table>
<p>You can add the failover option using the Generic NMSConnectionFactory class like this:</p>
<structured-macro ac:macro-id="32e8292d-4333-4ec7-a147-52ab3460a9e6" ac:name="noformat" ac:schema-version="1"><plain-text-body>
var cf = new NMSConnectionFactory(
"stomp:failover:tcp://localhost:61613");
</plain-text-body></structured-macro>
<p>You can also use the Stomp ConecctionFactory implementation directory:</p>
<structured-macro ac:macro-id="d2c17a8e-d03d-4b02-bbd3-850324c29e1d" ac:name="noformat" ac:schema-version="1"><plain-text-body>
var cf = new Apache.NMS.Stomp.ConnectionFactory(
"failover:tcp://localhost:61613");
</plain-text-body></structured-macro>
<h4><strong>Transport Options</strong></h4>
<h5><strong>TCP Transport Options</strong></h5>
<table><tbody><tr><th colspan="1" rowspan="1"><p> Option Name </p></th><th colspan="1" rowspan="1"><p> Default </p></th><th colspan="1" rowspan="1"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1"><p> transport.useLogging </p></td><td colspan="1" rowspan="1"><p> false </p></td><td colspan="1" rowspan="1"><p> Log data that is sent across the Transport. </p></td></tr><tr><td colspan="1" rowspan="1"><p> transport.receiveBufferSize </p></td><td colspan="1" rowspan="1"><p> 8192 </p></td><td colspan="1" rowspan="1"><p> Amount of Data to buffer from the Socket </p></td></tr><tr><td colspan="1" rowspan="1"><p> transport.sendBufferSize </p></td><td colspan="1" rowspan="1"><p> 8192 </p></td><td colspan="1" rowspan="1"><p> Amount of Data to buffer before writing to the Socket </p></td></tr><tr><td colspan="1" rowspan="1"><p> transport.receiveTimeout </p></td><td colspan="1" rowspan="1"><p> 0 </p></td><td colspan="1" rowspan="1"><p> Time to wait for more data, zero means wait infinitely </p></td></tr><tr><td colspan="1" rowspan="1"><p> transport.sendTimeout </p></td><td colspan="1" rowspan="1"><p> 0 </p></td><td colspan="1" rowspan="1"><p> Timeout on sends, 0 means wait forever for completion </p></td></tr><tr><td colspan="1" rowspan="1"><p> transport.requestTimeout </p></td><td colspan="1" rowspan="1"><p> 0 </p></td><td colspan="1" rowspan="1"><p> Time to wait before a Request Command is considered to have failed </p></td></tr><tr><td></td></tr></tbody></table>
<h5>Failover Transport Options</h5>
<p>Prior to NMS.Stomp v1.4.0 the failover transport options did not use the transport.* prefix.</p>
<table><tbody><tr><th colspan="1" rowspan="1"><p> Option Name </p></th><th colspan="1" rowspan="1"><p> Default </p></th><th colspan="1" rowspan="1"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1"><p> transport.timeout </p></td><td colspan="1" rowspan="1"><p> -1 </p></td><td colspan="1" rowspan="1"><p> Time that a send operation blocks before failing. </p></td></tr><tr><td colspan="1" rowspan="1"><p> transport.initialReconnectDelay </p></td><td colspan="1" rowspan="1"><p> 10 </p></td><td colspan="1" rowspan="1"><p> Time in Milliseconds that the transport waits before attempting to reconnect the first time. </p></td></tr><tr><td colspan="1" rowspan="1"><p> transport.maxReconnectDelay </p></td><td colspan="1" rowspan="1"><p> 30000 </p></td><td colspan="1" rowspan="1"><p> The max time in Milliseconds that the transport will wait before attempting to reconnect. </p></td></tr><tr><td colspan="1" rowspan="1"><p> transport.backOffMultiplier </p></td><td colspan="1" rowspan="1"><p> 2 </p></td><td colspan="1" rowspan="1"><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"><p> transport.useExponentialBackOff </p></td><td colspan="1" rowspan="1"><p> true </p></td><td colspan="1" rowspan="1"><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"><p> transport.randomize </p></td><td colspan="1" rowspan="1"><p> true </p></td><td colspan="1" rowspan="1"><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"><p> transport.maxReconnectAttempts </p></td><td colspan="1" rowspan="1"><p> 0 </p></td><td colspan="1" rowspan="1"><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"><p> transport.startupMaxReconnectAttempts </p></td><td colspan="1" rowspan="1"><p> 0 </p></td><td colspan="1" rowspan="1"><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"><p> transport.reconnectDelay </p></td><td colspan="1" rowspan="1"><p> 10 </p></td><td colspan="1" rowspan="1"><p> The delay in milliseconds that the transport waits before attempting a reconnection. </p></td></tr><tr><td></td></tr></tbody></table>
<h4><strong>Connection Options</strong></h4>
<table><tbody><tr><th colspan="1" rowspan="1"><p> Option Name </p></th><th colspan="1" rowspan="1"><p> Default </p></th><th colspan="1" rowspan="1"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1"><p> connection.AsyncSend </p></td><td colspan="1" rowspan="1"><p> false </p></td><td colspan="1" rowspan="1"><p> Are message sent Asynchronously. </p></td></tr><tr><td colspan="1" rowspan="1"><p> connection.AsyncClose </p></td><td colspan="1" rowspan="1"><p> true </p></td><td colspan="1" rowspan="1"><p> Should the close command be sent Asynchronously </p></td></tr><tr><td colspan="1" rowspan="1"><p> connection.AlwaysSyncSend </p></td><td colspan="1" rowspan="1"><p> false </p></td><td colspan="1" rowspan="1"><p> Causes all messages a Producer sends to be sent Asynchronously. </p></td></tr><tr><td colspan="1" rowspan="1"><p> connection.CopyMessageOnSend </p></td><td colspan="1" rowspan="1"><p> true </p></td><td colspan="1" rowspan="1"><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"><p> connection.useCompression </p></td><td colspan="1" rowspan="1"><p> false </p></td><td colspan="1" rowspan="1"><p> Should message bodies be compressed before being sent. </p></td></tr><tr><td colspan="1" rowspan="1"><p> connection.sendAcksAsync </p></td><td colspan="1" rowspan="1"><p> false </p></td><td colspan="1" rowspan="1"><p> Should message acks be sent asynchronously </p></td></tr><tr><td colspan="1" rowspan="1"><p> connection.messagePrioritySupported </p></td><td colspan="1" rowspan="1"><p> true </p></td><td colspan="1" rowspan="1"><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"><p> connection.dispatchAsync </p></td><td colspan="1" rowspan="1"><p> false </p></td><td colspan="1" rowspan="1"><p> Should the broker <a shape="rect" 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>
<h5><strong>Stomp Wire Protocol Options</strong></h5>
<structured-macro ac:macro-id="3c1a17fc-a887-4e54-9b9d-80ef1a9d74fe" ac:name="info" ac:schema-version="1"><parameter ac:name="title">Be Careful</parameter><rich-text-body>
<p>These values are currently not supported but are planned for a later release.</p></rich-text-body></structured-macro>
<table><tbody><tr><th colspan="1" rowspan="1"><p> Option Name </p></th><th colspan="1" rowspan="1"><p> Default </p></th><th colspan="1" rowspan="1"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1"><p> wireFormat.maxInactivityDuration </p></td><td colspan="1" rowspan="1"><p> 30000 </p></td><td colspan="1" rowspan="1"><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"><p> wireFormat.maxInactivityDurationInitialDelay </p></td><td colspan="1" rowspan="1"><p> 10000 </p></td><td colspan="1" rowspan="1"><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>
<h3><strong>Destination URI Parameters</strong></h3>
<h5>Example Configuration</h5>
<structured-macro ac:macro-id="d712c55b-ab45-4d96-929a-057c6d2f501d" ac:name="noformat" ac:schema-version="1"><plain-text-body>
d = session.CreateTopic("com.foo?consumer.prefetchSize=2000&amp;consumer.noLocal=true");
</plain-text-body></structured-macro>
<h4><strong>General Options</strong></h4>
<table><tbody><tr><th colspan="1" rowspan="1"><p> Option Name </p></th><th colspan="1" rowspan="1"><p> Default </p></th><th colspan="1" rowspan="1"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1"><p> consumer.prefetchSize </p></td><td colspan="1" rowspan="1"><p> 1000 </p></td><td colspan="1" rowspan="1"><p> The number of message the consumer will <a shape="rect" href="http://activemq.apache.org/what-is-the-prefetch-limit-for.html">prefetch</a>. </p></td></tr><tr><td colspan="1" rowspan="1"><p> consumer.noLocal </p></td><td colspan="1" rowspan="1"><p> false </p></td><td colspan="1" rowspan="1"><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"><p> consumer.dispatchAsync </p></td><td colspan="1" rowspan="1"><p> false </p></td><td colspan="1" rowspan="1"><p> Should the broker <a shape="rect" 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"><p> consumer.retroactive </p></td><td colspan="1" rowspan="1"><p> false </p></td><td colspan="1" rowspan="1"><p> Is this a <a shape="rect" href="http://activemq.apache.org/retroactive-consumer.html">Retroactive Consumer</a>. </p></td></tr><tr><td colspan="1" rowspan="1"><p> consumer.selector </p></td><td colspan="1" rowspan="1"><p> null </p></td><td colspan="1" rowspan="1"><p> JMS Selector used with the consumer. </p></td></tr><tr><td colspan="1" rowspan="1"><p> consumer.exclusive </p></td><td colspan="1" rowspan="1"><p> false </p></td><td colspan="1" rowspan="1"><p> Is this an <a shape="rect" href="http://activemq.apache.org/exclusive-consumer.html">Exclusive Consumer</a>. </p></td></tr></tbody></table>
</div>