Skip to main content

Stomp URI Configuration

Configuring NMS.Stomp​

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 NMS.Stomp client. The tables below show the comprehensive set of parameters.

Connection URI Parameters​

 Example Configuration​

Using the Generic NMSConnectionFactory class would look as follows:

var cf = new NMSConnectionFactory("stomp:tcp://localhost:61613");

You can also use the Stomp ConecctionFactory implementation directory:

var cf = new Apache.NMS.Stomp.ConnectionFactory("tcp://localhost:61613");

Protocol Options​

Option NameDescription
tcpUses TCP/IP Sockets to connect to the Broker.
sslUses TCP/IP Sockets to connect to the Broker with an added SSL layer (Not available on .NETCF).
failoverUses the Failover Transport to connect and reconnect to one or more Brokers

You can add the failover option using the Generic NMSConnectionFactory class like this:

var cf = new NMSConnectionFactory("stomp:failover:tcp://localhost:61613");

You can also use the Stomp ConecctionFactory implementation directory:

var cf = new Apache.NMS.Stomp.ConnectionFactory("failover:tcp://localhost:61613");

Transport Options​

TCP Transport Options​
Option NameDefaultDescription
transport.useLoggingfalseLog data that is sent across the Transport.
transport.receiveBufferSize8192Amount of Data to buffer from the Socket
transport.sendBufferSize8192Amount of Data to buffer before writing to the Socket
transport.receiveTimeout0Time to wait for more data, zero means wait infinitely
transport.sendTimeout0Timeout on sends, 0 means wait forever for completion
transport.requestTimeout0Time to wait before a Request Command is considered to have failed
Failover Transport Options​

Prior to NMS.Stomp v1.4.0 the failover transport options did not use the transport.* prefix.

Option NameDescription
transport.timeout-1
transport.initialReconnectDelay10
transport.maxReconnectDelay30000
transport.backOffMultiplier2
transport.useExponentialBackOfftrue
transport.randomizetrue
transport.maxReconnectAttempts0
transport.startupMaxReconnectAttempts0
transport.reconnectDelay10

Connection Options​

Option NameDefaultDescription
connection.AsyncSendfalseAre message sent Asynchronously.
connection.AsyncClosetrueShould the close command be sent Asynchronously
connection.AlwaysSyncSendfalseCauses all messages a Producer sends to be sent Asynchronously.
connection.CopyMessageOnSendtrueCopies the Message objects a Producer sends so that the client can reuse Message objects without affecting an in-flight message.
connection.useCompressionfalseShould message bodies be compressed before being sent.
connection.sendAcksAsyncfalseShould message acks be sent asynchronously
connection.messagePrioritySupportedtrueShould messages be delivered to the client based on the value of the Message Priority header.
connection.dispatchAsyncfalseShould the broker dispatch messages asynchronously to the connection's consumers.
Stomp Wire Protocol Options​

Be Careful

These values are currently not supported but are planned for a later release.

Option NameDefaultDescription
wireFormat.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 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.
wireFormat.maxInactivityDurationInitialDelay10000The initial delay in starting the maximum inactivity checks (and, yes, the word 'Initial' is supposed to be misspelled like that)

Destination URI Parameters​

Example Configuration​
d = session.CreateTopic("com.foo?consumer.prefetchSize=2000&consumer.noLocal=true");

General Options​

Option NameDefaultDescription
consumer.prefetchSize1000The number of message the consumer will prefetch.
consumer.noLocalfalseSame as the noLocal flag on a Topic consumer. Exposed here so that it can be used with a queue.
consumer.dispatchAsyncfalseShould the broker dispatch messages asynchronously to the consumer.
consumer.retroactivefalseIs this a Retroactive Consumer.
consumer.selectornullJMS Selector used with the consumer.
consumer.exclusivefalseIs this an Exclusive Consumer.