18.4. Work with Large Messages
18.4.1. Work with Large Messages
InputStream in the body of the message. When the message is sent HornetQ reads this InputStream and transmits data to the server in fragments.
OutputStream on the message to stream it in fragments to a disk file.
18.4.2. Configuring HornetQ Large Messages
In Standalone mode large messages are stored in EAP_HOME/standalone/data/largemessages directory. In Domain mode large messages are stored in EAP_HOME/domain/servers/SERVERNAME/data/largemessages directory. The configuration property large-messages-directory indicates the location where large messages are stored.
Important
18.4.3. Configuring Parameters
- Using HornetQ Core API on Client Side
- If you are using HornetQ Core API on client side you need to set
ServerLocator.setMinLargeMessageSizeparameter to specify minimum size of large messages. The minimum size of large messages(min-large-message-size) is set to 100KiB by default.ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName())) locator.setMinLargeMessageSize(25 * 1024); ClientSessionFactory factory = HornetQClient.createClientSessionFactory();
- Configuring server for Java Messaging Service (JMS) clients
- If you using Java Messaging Service (JMS) you need to specify the minimum size of large messages in the attribute
min-large-message-sizeof your server configuration files (standalone.xmlanddomain.xml). The minimum size of large messages(min-large-message-size) is set to 100KiB by default.Note
The value of the attributemin-large-message-sizeshould be in bytesYou may choose to compress large messages for fast and efficient transfer. All compression/de-compression operations are handled on client side. If the compressed message is smaller thanmin-large-message-size,it is sent to the server as a regular message. Using Java Messaging Service (JMS) you can compress large messages by setting the boolean propertycompress-large-messages"true" on the server locator or ConnectionFactory.<connection-factory name="ConnectionFactory"> <connectors> <connector-ref connector-name="netty"/> </connectors> ... <min-large-message-size>204800</min-large-message-size> <compress-large-messages>true</compress-large-messages> </connection-factory>

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.