The OpenWire Wire Format
OpenWire is the default Wire Format that ActiveMQ uses. It provides a highly efficent binary format for high speed messaging. OpenWire options can be configured on a JMS client's connection URI string or on a Brokers transport bind URI.
Parameter Name |
Default Value |
Description |
stackTraceEnabled |
true |
Should the stack trace of exception that occur on the broker be sent to the client? |
tcpNoDelayEnabled |
false |
Does not affect the wire format, but provides a hint to the peer that TCP nodelay should be enabled on the communications Socket. |
| cacheEnabled |
true |
Should commonly repeated values be cached so that less marshalling occurs? |
| tightEncodingEnabled |
true |
Should wire size be optimized over CPU usage ? |
| prefixPacketSize |
true |
Should the size of the packet be prefixed before each packet is marshalled? |
| maxInactivityDuration |
30000 |
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 <= 0 to disable inactivity monitoring. |
| maxInactivityDurationInitalDelay |
10000 |
The initial delay in starting the maximum inactivity checks (and, yes, the word 'Inital' is supposed to be misspelled like that) |
| cacheSize |
1024 |
If cacheEnabled is true, then this specifies the maximum number of values to cached. This property was added in ActiveMQ 4.1 |
| maxFrameSize |
104857600 |
Maximum frame size that can be sent. Added in 5.6.0 with default value of 100 MB, it should help prevent DOS attacks |
All options for wire formats must be prepended with wireFormat. in order to take effect. Without this proper formatting, the option will have zero effect.
When using the maxInactivityDuration option, the setting must match on both sides of the connection. The default value the maxInactivityDuration option on the broker side is 30 seconds so each consumer must have the same setting so that the option actually takes effect. If the settings do not match, the option will have no effect.
Example Configurations
Java:
ActiveMQConnectionFactory cf =
new ActiveMQConnectionFactory("tcp:);
Spring:
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL"
value="failover:(tcp://localhost:61616?jms.optimizeAcknowledge=false&wireFormat.maxInactivityDuration=30000)" />