Author |
Message
|
balajirprasad |
Posted: Tue Sep 19, 2006 9:00 pm Post subject: MQGET options |
|
|
Newbie
Joined: 19 Sep 2006 Posts: 4
|
I've a VB application which uses MQ to read messages from a queue and
upload it to database. I'm using the MQGET option to receive a message, the problem I face is if the message size is greater than 65KB it fails with
reason code 2080 because the buffer size is limited to 65KB only. I tried
to increase the buffer size in VB but couldn't since a string variable can
hold only 65525bytes. Is there any way to split the message using MQGET so that I can store it in a string variable in VB?
Can anyone please help me on this? |
|
Back to top |
|
 |
zpat |
Posted: Tue Sep 19, 2006 10:37 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
If you are not interested in the data beyond your buffer size then code MQGMO_ACCEPT_TRUNCATED_MSG
You will get a warning CC of 2079 if the data is truncated. |
|
Back to top |
|
 |
balajirprasad |
Posted: Tue Sep 19, 2006 11:02 pm Post subject: |
|
|
Newbie
Joined: 19 Sep 2006 Posts: 4
|
Hi,
Thanks for your response.
But, I want the full message to be retrieved. Is there any way I can do by splitting the message so tha I can receive it in two or more VB string variables. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Sep 20, 2006 12:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Messages can be sent in segments by the sending application but if you've got a message greater than 65K on a queue then you can't get MQ to split it on get.
You've hit a limitation of VB I'm afraid. You don't say which version of VB but I'm not aware of any large storage types (anyone?). When I was in this situation (somewhat against my will) with VB6 I put together a C function to read the message off the queue (into a buffer large enough to hold it) and that then returned the contents to VB in a string array. Not elegant, but it worked and it was a stupid constraint anyway! (Some clients.... )
I don't think MQ will help at this point. You need the message segmented on send. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
balajirprasad |
Posted: Wed Sep 20, 2006 12:05 am Post subject: |
|
|
Newbie
Joined: 19 Sep 2006 Posts: 4
|
I'm using VB6. Ok I'll try your way of using a C function to get the message. Thanks for your help..... |
|
Back to top |
|
 |
balajirprasad |
Posted: Wed Sep 20, 2006 12:31 am Post subject: |
|
|
Newbie
Joined: 19 Sep 2006 Posts: 4
|
Hi Vitor,
I'm using MQGET and the buffer variable i've in the parameter option is string and is not able to hold the full message. How can I get the message from the queue without using MQGET and put it into a file? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Sep 20, 2006 12:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
balajirprasad wrote: |
Hi Vitor,
I'm using MQGET and the buffer variable i've in the parameter option is string and is not able to hold the full message. How can I get the message from the queue without using MQGET and put it into a file? |
a) Following from your previous post, if you're using a C app to read the message and claim it won't fit in a C string there's something very wrong. I suspect it's with your knowledege of C.
b) MQGET is the only way of getting a message from a queue. If your C program can't describe a structure long enough to hold your message then none of the other facilties will help, as they're all written in C.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
tleichen |
Posted: Wed Sep 20, 2006 6:02 am Post subject: |
|
|
Yatiri
Joined: 11 Apr 2005 Posts: 663 Location: Center of the USA
|
You can use a C type structure with char elements. You can have as many of these elements as you like, as long as the total length of the structure meets or exceeds your required buffer size. I've done this before and it works fine.  _________________ IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer |
|
Back to top |
|
 |
|