| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> |
| <title>ActiveMQ</title> |
| <link rel="icon" type="image/png" href="/assets/img/favicon.png"> |
| |
| <link rel="stylesheet" href="/css/main.css"> |
| <script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js" integrity="sha384-SlE991lGASHoBfWbelyBPLsUlwY1GwNDJo3jSJO04KZ33K2bwfV9YBauFfnzvynJ" crossorigin="anonymous"></script> |
| <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script> |
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> |
| </head> |
| |
| <body> |
| <nav class="navbar navbar-expand-lg navbar-light fixed-top"> |
| <div class="container"> |
| <!-- <a class="navbar-brand mr-auto" href="#"><img style="height: 50px" src="assets/img/apache-feather.png" /></a> --> |
| <a class="navbar-brand mr-auto" href="/"><img src="/assets/img/activemq_logo_black_small.png" style="height: 50px"/></a> |
| <button class="navbar-toggler ml-auto" type="button" data-toggle="collapse" data-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation"> |
| <span class="navbar-toggler-icon"></span> |
| </button> |
| |
| <div class="ml-auto collapse navbar-collapse" id="navbarContent"> |
| <ul class="navbar-nav ml-auto"> |
| <li class="nav-item"> |
| <a class="nav-link active" href="/index.html">Home</a> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link" id="navbarDropdownComponents" data-target="#" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Components</a> |
| <ul class="dropdown-menu dropdown-menu-center" aria-labelledby="navbarDropdownComponents"> |
| <div class="row"> |
| <div class="col-12"> |
| <ul class="multi-column-dropdown"> |
| <li class="nav-item"><a class="dropdown-item" href="/components/classic">ActiveMQ 5</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/components/artemis/">ActiveMQ Artemis</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/components/nms">NMS Clients</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/components/cms">CMS Client</a></li> |
| </ul> |
| </div> |
| </div> |
| </ul> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link" id="navbarDropdownCommunity" data-target="#" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Contact</a> |
| <ul class="dropdown-menu dropdown-menu-center multi-column columns-1" aria-labelledby="navbarDropdownCommunity"> |
| <div class="row"> |
| <div class="col-12"> |
| <ul class="multi-column-dropdown"> |
| <li class="nav-item"><a class="dropdown-item" href="/contact#mailing">Mailing Lists</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/contact#chat">Chat</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/contact#issues">Report Issues</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/contact#contributing">Contributing</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/security-advisories.html">Security</a></li> |
| </ul> |
| </div> |
| </div> |
| </ul> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link" id="navbarDropdownTeam" data-target="#" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Apache</a> |
| <ul class="dropdown-menu dropdown-menu-center multi-column columns-1" aria-labelledby="navbarDropdownTeam"> |
| <div class="row"> |
| <div class="col-sm-12"> |
| <ul class="multi-column-dropdown"> |
| <li class="nav-item"><a class="dropdown-item" href="https://www.apache.org">The Apache Software Foundation</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="https://www.apache.org/licenses/">License</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="https://www.apache.org/foundation/thanks.html">Thanks</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/security-advisories.html">Security</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="https://www.apache.org/events/current-event">Events</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="https://people.apache.org/phonebook.html?pmc=activemq">PMC & Committers</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/team/reports">Board Reports</a></li> |
| </ul> |
| </div> |
| </div> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </nav> |
| |
| <div class="content"> |
| <div class="page-title-activemq5"> |
| <div class="container"> |
| <h1>Configuring Wire Formats</h1> |
| </div> |
| </div> |
| <div class="container" > |
| <div class="row" style="margin-top: 30px"> |
| <div class="col-12 activemq5"> |
| <p><a href="using-activemq">Using ActiveMQ</a> > <a href="configuring-transports">Configuring Transports</a> > <a href="activemq-connection-uris">ActiveMQ Connection URIs</a> > <a href="configuring-wire-formats">Configuring Wire Format</a></p> |
| |
| <h3 id="the-openwire-wire-format">The OpenWire Wire Format</h3> |
| |
| <p>OpenWire is the default wire format used by ActiveMQ. It provides a highly efficient binary format for high speed messaging. OpenWire options can be configured on a JMS client’s connection URI or on a broker’s transport bind URI.</p> |
| |
| <table> |
| <thead> |
| <tr> |
| <th>Option</th> |
| <th>Default</th> |
| <th>Description</th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td><code class="highlighter-rouge">cacheEnabled</code></td> |
| <td><code class="highlighter-rouge">true</code></td> |
| <td>Should commonly repeated values be cached so that less marshaling occurs?</td> |
| </tr> |
| <tr> |
| <td><code class="highlighter-rouge">cacheSize</code></td> |
| <td><code class="highlighter-rouge">1024</code></td> |
| <td>When <code class="highlighter-rouge">cacheEnabled=true</code> then this parameter is used to specify the number of values to be cached.</td> |
| </tr> |
| <tr> |
| <td><code class="highlighter-rouge">maxInactivityDuration</code></td> |
| <td><code class="highlighter-rouge">30000</code></td> |
| <td>The maximum <a href="activemq-inactivitymonitor">inactivity</a> 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. Inactivity monitoring is disabled when set to a value <code class="highlighter-rouge"><= 0</code>.</td> |
| </tr> |
| <tr> |
| <td><code class="highlighter-rouge">maxInactivityDurationInitalDelay</code></td> |
| <td><code class="highlighter-rouge">10000</code></td> |
| <td>The initial delay before starting <a href="activemq-inactivitymonitor">inactivity</a> checks. Yes, the word <code class="highlighter-rouge">'Inital'</code> is supposed to be misspelled like that.</td> |
| </tr> |
| <tr> |
| <td><code class="highlighter-rouge">maxFrameSize</code></td> |
| <td><code class="highlighter-rouge">MAX_LONG</code></td> |
| <td>Maximum allowed frame size. Can help help prevent OOM DOS attacks.</td> |
| </tr> |
| <tr> |
| <td><code class="highlighter-rouge">sizePrefixDisabled</code></td> |
| <td><code class="highlighter-rouge">false</code></td> |
| <td>Should the size of the packet be prefixed before each packet is marshaled?</td> |
| </tr> |
| <tr> |
| <td><code class="highlighter-rouge">stackTraceEnabled</code></td> |
| <td><code class="highlighter-rouge">true</code></td> |
| <td>Should the stack trace of exception that occur on the broker be sent to the client?</td> |
| </tr> |
| <tr> |
| <td><code class="highlighter-rouge">tcpNoDelayEnabled</code></td> |
| <td><code class="highlighter-rouge">true</code></td> |
| <td>Does not affect the wire format, but provides a hint to the peer that <code class="highlighter-rouge">TCP_NODELAY</code> should be enabled on the communications Socket.</td> |
| </tr> |
| <tr> |
| <td><code class="highlighter-rouge">tightEncodingEnabled</code></td> |
| <td><code class="highlighter-rouge">true</code></td> |
| <td>Should wire size be optimized over CPU usage?</td> |
| </tr> |
| </tbody> |
| </table> |
| |
| <blockquote> |
| <p><strong>Use the Correct Prefix!</strong></p> |
| |
| <p>Wire format options must have the prefix <code class="highlighter-rouge">wireFormat.</code> to take effect, e.g., <code class="highlighter-rouge">wireFormat.maxInactivityDuration=10000</code>. Options missing this prefix will be ignored.</p> |
| </blockquote> |
| |
| <h4 id="example-configurations">Example Configurations</h4> |
| |
| <p><strong>Java:</strong></p> |
| <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?wireFormat.cacheEnabled=false&wireFormat.tightEncodingEnabled=false"); |
| </code></pre></div></div> |
| |
| <p><strong>Spring:</strong></p> |
| <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code><bean class="org.apache.activemq.ActiveMQConnectionFactory"> |
| <property name="brokerURL" value="failover:(tcp://localhost:61616?jms.optimizeAcknowledge=false&wireFormat.maxInactivityDuration=30000)"/> |
| <!-- other options... --> |
| </bean> |
| </code></pre></div></div> |
| |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="row sitemap"> |
| <div class="col-sm-12"> |
| <div class="container"> |
| <div class="row"> |
| <div class="col-sm-12"> |
| <div class="row"> |
| <div class="col-sm-3"> |
| <div > |
| <img class="float-left" style="max-height: 100px" src="/assets/img/activemq_logo_white_vertical_small.png"/> |
| </div> |
| </div> |
| <div style="text-align: center; margin-bottom: 0px; margin-top: 30px; font-size: 65%" class="col-sm-6"> |
| <p>Apache ActiveMQ, ActiveMQ, ActiveMQ Artemis, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. Copyright © 2019, The Apache Software Foundation. Licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.</p> |
| </div> |
| <div class="col-sm-3"> |
| <div > |
| <a href="https://www.apache.org"><img class="float-right" style="margin-top: 10px; max-height: 80px" src="/assets/img/apache-logo-small.png"/></a> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| |
| </body> |
| </html> |