blob: 4e25b9da4a4912116a21466510b69086d4a4eb08 [file] [log] [blame]
<div class="wiki-content maincontent"><h3>The OpenWire Wire Format</h3><p>OpenWire is the default wire format used by ActiveMQ.&#160; It provides a highly efficient binary format for high speed messaging.&#160; OpenWire options can be configured on a JMS client's connection URI or on a broker's transport bind URI.</p><table><tbody><tr><th colspan="1" rowspan="1"><p>Option</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><code>cacheEnabled</code></p></td><td colspan="1" rowspan="1"><p><code>true</code></p></td><td colspan="1" rowspan="1"><p>Should commonly repeated values be cached so that less marshaling occurs?</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>cacheSize</code></p></td><td colspan="1" rowspan="1"><p><code>1024</code></p></td><td colspan="1" rowspan="1"><p>When&#160;<strong><code>cacheEnabled=true</code></strong> then this parameter is used to specify the number of values to be cached.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>maxInactivityDuration</code></p></td><td colspan="1" rowspan="1"><p><code>30000</code></p></td><td colspan="1" rowspan="1"><p>The maximum <link><page ri:content-title="ActiveMQ InactivityMonitor"></page><plain-text-link-body>inactivity</plain-text-link-body></link> duration (before which the socket is considered dead) in milliseconds. On some platforms it can take a long time for a socket to die. Therefore allow the broker to kill connections when they have been inactive for the configured period of time. Used by some transports to enable a keep alive heart beat feature.</p><p>Inactivity monitoring is disabled when set to a value <strong><code>&lt;= 0</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>maxInactivityDurationInitalDelay</code></p></td><td colspan="1" rowspan="1"><p><code>10000</code></p></td><td colspan="1" rowspan="1"><p>The initial delay before starting <link><page ri:content-title="ActiveMQ InactivityMonitor"></page><plain-text-link-body>inactivity</plain-text-link-body></link> checks.</p><p>Yes, the word&#160;<strong><code>'Inital'</code></strong> is supposed to be misspelled like that.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>maxFrameSize</code></p></td><td colspan="1" rowspan="1"><p><code>MAX_LONG</code></p></td><td colspan="1" rowspan="1"><p>Maximum allowed frame size. Can help help prevent OOM DOS attacks.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>sizePrefixDisabled</code></p></td><td colspan="1" rowspan="1"><p><code>false</code></p></td><td colspan="1" rowspan="1"><p>Should the size of the packet be prefixed before each packet is marshaled?</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>stackTraceEnabled</code></p></td><td colspan="1" rowspan="1"><p><code>true</code></p></td><td colspan="1" rowspan="1"><p>Should the stack trace of exception that occur on the broker be sent to the client?</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>tcpNoDelayEnabled</code></p></td><td colspan="1" rowspan="1"><p><code>true</code></p></td><td colspan="1" rowspan="1"><p>Does not affect the wire format, but provides a hint to the peer that&#160;<strong><code>TCP_NODELAY</code></strong> should be enabled on the communications Socket.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>tightEncodingEnabled</code></p></td><td colspan="1" rowspan="1"><p><code>true</code></p></td><td colspan="1" rowspan="1"><p>Should wire size be optimized over CPU usage?</p></td></tr></tbody></table><structured-macro ac:macro-id="5f63c58b-03ae-42b4-acb9-5129da2b15db" ac:name="warning" ac:schema-version="1"><parameter ac:name="title">Use the Correct Prefix!</parameter><rich-text-body><p>Wire format options must have the prefix&#160;<strong><code>wireFormat.</code></strong> to take effect, e.g.,&#160;<strong><code>wireFormat.maxInactivityDuration=10000</code></strong>. Options missing this prefix will be ignored.</p></rich-text-body></structured-macro><h4>Example Configurations</h4><p><strong>Java:</strong></p><structured-macro ac:macro-id="82d9cc9e-c50c-4ac4-9e27-ae3d5cc4a5ac" ac:name="code" ac:schema-version="1"><parameter ac:name="language">java</parameter><plain-text-body>ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?wireFormat.cacheEnabled=false&amp;wireFormat.tightEncodingEnabled=false");</plain-text-body></structured-macro><p><strong><br clear="none"></strong></p><p>&#160;</p><p><strong>Spring:</strong></p><structured-macro ac:macro-id="554a55c5-5f0b-489e-ab16-f3d317658e94" ac:name="code" ac:schema-version="1"><parameter ac:name="language">xml</parameter><plain-text-body>&lt;bean class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
&lt;property name="brokerURL" value="failover:(tcp://localhost:61616?jms.optimizeAcknowledge=false&amp;wireFormat.maxInactivityDuration=30000)"/&gt;
&lt;!-- other options... --&gt;
&lt;/bean&gt;</plain-text-body></structured-macro><p>&#160;</p><p>&#160;</p><p><strong><br clear="none"></strong></p><p>&#160;</p></div>