Set a Streaming Alternative

WARNING - TOPIC NOT WRITTEN - TOPIC ID: 670

This topic has not yet been written. The content below is from the topic description.
23.4. Streaming Alternative If you choose not to use the InputStream or OutputStream capability of HornetQ You could still access the data directly in an alternative fashion. On the Core API just get the bytes of the body as you normally would. ClientMessage msg = consumer.receive(); byte[] bytes = new byte[1024]; for (int i = 0 ; i < msg.getBodySize(); i += bytes.length) { msg.getBody().readBytes(bytes); // Whatever you want to do with the bytes } If using JMS API, BytesMessage and StreamMessage also supports it transparently. BytesMessage rm = (BytesMessage)cons.receive(10000); byte data[] = new byte[1024]; for (int i = 0; i < rm.getBodyLength(); i += 1024) { int numberOfBytes = rm.readBytes(data); // Do whatever you want with the data }