This page is out of date. For up to date details refer to the Qpid JMS client documentation and the Broker Ports section with the Java Broker book.

Tuning the broker for your message size.

The default buffer size used per message on the broker and client is 32kb if your message is significantly smaller you can improve your memory usage by lowering this value.

What size to use

When selecting what size of buffer to include space for any JMS Headers that may be defined (key and value). You should also include 200 bytes for the AMQP routing details, if you have very long queue or topic names you may wish to increase this value further.

How to change the buffer sizes

Broker Buffers

In your broker configuration file the socketSend/ReceiveBuffer value of 32768 is where the buffer size is specified.
Currently your configuration file will contain the following two entries:

<connector>
    ...
    <socketReceiveBuffer>32768</socketReceiveBuffer>
    <socketSendBuffer>32768</socketSendBuffer>
</connector>

Modifying these will adjust the size of the ByteBuffers used in conjunction with the socket.

Client Buffers

Adjusting the client buffers can also assist your client heap management if you are prefetching a large number of messages.
However, adjusting this will not have any affect on the broker's memory usage.
If you also want to modify the client buffer size then there are two system properties that need set:

amqj.sendBufferSize
amqj.receiveBufferSize

These need to be set prior to making the initial connection.
For more details on these properties see: System Properties

  • No labels