The configuration of ActiveMQ is so slick, we decided to take a similar approach with ActiveMQ-CPP. 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 ActiveMQ-CPP client. The tables below show the comprehensive set of parameters.

Connection URI Parameters

Example Configuration

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

Socket Options

Option NameDefaultDescription
inputBufferSize10000The number of bytes in the buffered input stream's buffer
outputBufferSize10000The number of bytes in the buffered output stream's buffer
soLinger0Socket SOLinger value
soKeepAlivefalseSocket SOKeepAlive value
soReceiveBufferSize-1Socket receive buffer. If -1, use OS default.
soSendBufferSize-1Socket send buffer. If -1, use OS default.

Transport Options

Option NameDefaultDescription
commandTracingEnabledfalseIf true, enables tracing of incoming and outgoing transport commands
tcpTracingEnabledfalseIf true, enables tracing of raw network IO (in hex)
useAsyncSendfalseIf true, enables asynchronous sending of messages.

Transaction Options

Option NameDefaultDescription
transaction.maxRedeliveryCount5Maximum number of redelivery attempts.

Wire Format Protocol Options

Option NameDefaultDescription
wireFormatopenwireSelects the wire format to use. Out of the box, can be either stomp or openwire.
wireFormat.stackTraceEnabledfalseShould the stack trace of exception that occur on the broker be sent to the client? Only used by openwire protocol.
wireFormat.cacheEnabledfalseShould commonly repeated values be cached so that less marshalling occurs? Only used by openwire protocol.
wireFormat.tcpNoDelayEnabledfalseDoes not affect the wire format, but provides a hint to the peer that TCP nodelay should be enabled on the communications Socket. Only used by openwire protocol.
wireFormat.sizePrefixDisabledfalseShould serialized messages include a payload length prefix? Only used by openwire protocol.
wireFormat.tightEncodingEnabledfalseShould wire size be optimized over CPU usage? Only used by the openwire protocol.

Destination URI Parameters

Example Configuration

d = session->createTopic("com.foo?consumer.prefetchSize=2000&consumer.noLocal=true");

General Options

Option NameDefaultDescription
consumer.prefetchSize 1000 The number of message the consumer will prefetch.
consumer.maximumPendingMessageLimit 0 Use to control if messages are dropped if a slow consumer situation exists.
consumer.noLocal false Same as the noLocal flag on a Topic consumer. Exposed here so that it can be used with a queue.
consumer.dispatchAsync false Should the broker dispatch messages asynchronously to the consumer.
consumer.retroactive false Is this a Retroactive Consumer.
consumer.selector null JMS Selector used with the consumer.
consumer.exclusive false Is this an Exclusive Consumer.
consumer.priority 0 Allows you to configure a Consumer Priority.

OpenWire-only Options

Option NameDefaultDescription
consumer.browserfalse 
consumer.networkSubscriptionfalse 
consumer.optimizedAcknowledgefalse Enables an optimised acknowledgement mode where messages are acknowledged in batches rather than individually. Alternatively, you could use Session.DUPS_OK_ACKNOWLEDGE acknowledgement mode for the consumers which can often be faster. WARNING enabling this issue could cause some issues with auto-acknowledgement on reconnection
consumer.noRangeAcksfalse 
consumer.retroactivefalseSets whether or not retroactive consumers are enabled. Retroactive consumers allow non-durable topic subscribers to receive old messages that were published before the non-durable subscriber started.
producer.dispatchAsycfalse 
© 2004-2011 The Apache Software Foundation.
Apache ActiveMQ, ActiveMQ, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram