layout: default_md title: Configuring Wire Formats title-class: page-title-activemq5 type: activemq5

Using ActiveMQ > Configuring Transports > ActiveMQ Connection URIs > Configuring Wire Format

The OpenWire Wire Format

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.

OptionDefaultDescription
cacheEnabledtrueShould commonly repeated values be cached so that less marshaling occurs?
cacheSize1024When cacheEnabled=true then this parameter is used to specify the number of values to be cached.
maxInactivityDuration30000The 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 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 <= 0.
maxInactivityDurationInitalDelay10000The initial delay before starting inactivity checks. Yes, the word 'Inital' is supposed to be misspelled like that.
maxFrameSizeMAX_LONGMaximum allowed frame size. Can help help prevent OOM DOS attacks.
sizePrefixDisabledfalseShould the size of the packet be prefixed before each packet is marshaled?
stackTraceEnabledtrueShould the stack trace of exception that occur on the broker be sent to the client?
tcpNoDelayEnabledtrueDoes not affect the wire format, but provides a hint to the peer that TCP_NODELAY should be enabled on the communications Socket.
tightEncodingEnabledtrueShould wire size be optimized over CPU usage?

Use the Correct Prefix!

Wire format options must have the prefix wireFormat. to take effect, e.g., wireFormat.maxInactivityDuration=10000. Options missing this prefix will be ignored.

Example Configurations

Java:

ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?wireFormat.cacheEnabled=false&wireFormat.tightEncodingEnabled=false");

Spring:

<bean class="org.apache.activemq.ActiveMQConnectionFactory">
  <property name="brokerURL" value="failover:(tcp://localhost:61616?jms.optimizeAcknowledge=false&wireFormat.maxInactivityDuration=30000)"/>
  <!-- other options... -->
</bean>