Equivalent to org.hornetq.api.core.client.ClientMessage.setBodyInputStream in IBM MQSeries

In the next page of the JBoss / HornetQ user manual, you can see how HornetQ provides a mechanism for streaming Message data to a queue using java.io.InputStream. Given a JMS version of the same code. Has anyone come across an equivalent using IBM MQSeries / WebsphereMQ?

Let's say I have a large amount of data to fit in a JMS message, to me it's just a stream of bytes. In the Hornet example, the stream is read only when the message is sent, so if there is one, say FileInputStream, then we only need enough memory to buffer the bytes. I can use javax.jms.BytesMessage to send chunks of bytes and use BytesMessage to buffer them. The problem is that the IBM BytesMessage implementation (com.ibm.msg.client.jms.internal.JmsBytesMessageImpl) has to cache them until the message is sent, and if it is a large amount of data this is a problem. Worse, it seems that even though I'm only sending bytes, the IBM implementation seems to store duplicate copies, one in BytesArrayOutputStream and another in DataOutputStream.

+3


source to share


2 answers


In WebSphere MQ, the closest thing to what you are describing is the help message . The method described in Infocenter requires special programming of the pipe outputs to capture a file system object and place it in a message before it is sent over the pipe. The optional output to the remote side saves the payload to a file and puts a link to the file in a message that is returned to the application.



We also have programs in WMQ that take an STDIN or pipe at one end and queue messages at the other end. A couple of these can act as a conduit through which ASCII thread-safe data is passed between processes on separate machines. However, there is no JMS implementation of this, and it doesn't work too well for binary data.

+1


source


At WMQ, we have a group and segment concept. Segmentation is supported on all operating systems except Z / OS.

Read more here Segmentation In WMQ

Use GroupId, MsgSeqNumber and Offset when posting the message.



When you receive a message, if you give MQGMO_COMPLETE_MSG in GMO, all segments are automatically connected according to MsgSeqNumber and

you will receive one message in the receiving application with one GET.

0


source