Questo contenuto non è disponibile nella lingua selezionata.
21.3.2. Streaming over JMS
When using JMS, HornetQ maps the streaming methods on the core API (see Table 21.1, “org.hornetq.api.core.client.ClientMessage API”) by setting object properties. You can use the method
Message.setObjectProperty to set the input and output streams.
The
InputStream can be defined through the JMS Object Property JMS_HQ_InputStream on messages being sent:
The
OutputStream can be set through the JMS Object Property JMS_HQ_SaveStream on messages being received in a blocking way.
Setting the
OutputStream could also be done in a non-blocking way using the property JMS_HQ_OutputStream.
// This will not wait the stream to finish. You need to keep the consumer active.
messageReceived.setObjectProperty("JMS_HQ_OutputStream", bufferedOutput);
// This will not wait the stream to finish. You need to keep the consumer active.
messageReceived.setObjectProperty("JMS_HQ_OutputStream", bufferedOutput);
Note
When using JMS, Streaming large messages are only supported on
StreamMessage and BytesMessage.