Author |
Message
|
andyfives |
Posted: Tue Dec 15, 2009 8:36 am Post subject: mqseries api - sending data from a file |
|
|
Newbie
Joined: 09 Dec 2009 Posts: 9
|
Hello there (again),
We can now send a string from the client application we are building onto our test queue. This works great.., but
We would really like to send a data from a file (of variable size) to the queue.
And I looked into this building a Logical Unit of Work (LUW) process that the old client program used where we
- start the connection,
- start the LUW
- MQPUT each line of the file into this LUW
- then COMMIT it.
We tried to use the MQBEGIN method, but found out that you can place a MQPMO_SYNCPOINT value in the options for the first MQPUT and that should work.
But we are still sending a message for each MQPUT we make. Is there something obvious I am missing? Is there an easier way to work with files?
We have to replace really 'like for like' and as LUW is used today it would be great if we could replicate this.
Any advise would be appreciated.. Thanks
Andy |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Dec 15, 2009 8:44 am Post subject: Re: mqseries api - sending data from a file |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
andyfives wrote: |
But we are still sending a message for each MQPUT we make. |
That is exactly and completely the definition of what MQPUT does.
It Puts a single message. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 15, 2009 10:31 am Post subject: Re: mqseries api - sending data from a file |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
andyfives wrote: |
But we are still sending a message for each MQPUT we make. Is there something obvious I am missing? |
Yes. Each put is supposed to send a message; that's kind of the point. If you want the file as a single message, assemble it as a single message and put it. You're allowed 100Mb as a single message (though a spot of configuration is needed for greater than 4Mb).
andyfives wrote: |
Is there an easier way to work with files? |
Buy FTE or another commercial solution rather than reinvent the wheel. Files can be tricky. As you've discovered. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
andyfives |
Posted: Tue Dec 15, 2009 10:39 am Post subject: |
|
|
Newbie
Joined: 09 Dec 2009 Posts: 9
|
Ok, that sounds good.
We'll not go over the 4mb, so we'll assemble it into 1 message.
Thanks for feedback. |
|
Back to top |
|
 |
zpat |
Posted: Wed Dec 16, 2009 5:05 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
If you use multiple MQPUTs the CMIT or BACK will apply to all of them under one UOW.
Using one message is not really scalable, not is it really the correct MQ model which is closer to a message per record or data item than just transporting a file in a message. You can use grouping if necessary.
Even reading a file means that you are not producing messages directly from the application which is the true messaging model. |
|
Back to top |
|
 |
|