Author |
Message
|
sigolfer |
Posted: Tue Dec 23, 2008 10:43 am Post subject: Unreadable Buffer data in MQGET using VB 6 in client connect |
|
|
Newbie
Joined: 23 Dec 2008 Posts: 3
|
I'm getting unreadable data returned in the Buffer when issuing an MQGET to a remote queue on a Linux server. My VB client is running on Windows XP.
I'm trying to set up basic Client Put and Get with at test queue on the server. I can Put a test message onto the queue ("test") but when I Get the message off the queue, the buffer is unreadable.
I'm using the same CCSID when Putting as Getting.
Here is the code I'm using:
MQGMO_DEFAULTS gmo
' use MQGMO_SYNCPOINT in combination with MQCMIT below to guarantee retrieval of the message
gmo.Options = MQGMO_WAIT + MQGMO_CONVERT
gmo.WaitInterval = 1000
'setup message descriptor to the required values
MQMD_DEFAULTS md
md.Format = MQFMT_STRING
md.CodedCharSetId = CLng(437)
'setup length of GET buffer
buflen = 1000
'get message from the queue
MQGET Connection_Hcon, GetQueue_Hobj, md, gmo, buflen, Buffer, messlen, CompCode, Reason
Here is what is returned in the value:
9}tÿQëÿQƒMüÿë3À@ËeèƒMüÿ3ÿ‹uàÿEäëª3ÀèL¯þÿÂ
Any help will be greatly appreciated. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 23, 2008 10:49 am Post subject: Re: Unreadable Buffer data in MQGET using VB 6 in client con |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sigolfer wrote: |
I can Put a test message onto the queue ("test") but when I Get the message off the queue, the buffer is unreadable.
|
What is putting the message? Could it be adding headers a la JMS? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
sigolfer |
Posted: Tue Dec 23, 2008 11:03 am Post subject: |
|
|
Newbie
Joined: 23 Dec 2008 Posts: 3
|
I'm Putting the message within the same VB client application as I'm getting the message. Using QPasa!, I was able to verify that the message is successfully on the queue and has no headers.
I'm using cmqb.bas and cmqxb.bas from the VB client samples provided.
I open the queue for PUT and place the test message on the queue. I then close the queue and reopen it for GET and retrieve the message.
This is a proof of concept app before we move forward with implementing Client connections and remove the local queue managers from the application servers. |
|
Back to top |
|
 |
gbaddeley |
Posted: Sat Dec 27, 2008 3:28 am Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
How are you declaring Buffer? It needs to be preallocated in the VB program to be at least buflen bytes long. _________________ Glenn |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Dec 30, 2008 3:34 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
...when I Get the message off the queue, the buffer is unreadable. |
Do you mean that the MQGET failed to get the message? Or, do you mean that the MQGET succeeded?
If the MQGET was successful, exactly what do you mean by unreadable? What is the actual message length returned from the MQGET call? Is the buffer empty? If not, what is in the buffer? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
zpat |
Posted: Wed Dec 31, 2008 12:26 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
What is the MQRC?
Sometimes messages cannot be converted, they may not have format MQSTR (which is set on the put not the get). |
|
Back to top |
|
 |
sigolfer |
Posted: Wed Dec 31, 2008 12:01 pm Post subject: Unreadable Buffer data in MQGET using VB 6 in client connect |
|
|
Newbie
Joined: 23 Dec 2008 Posts: 3
|
The MQGET was succeeding but the message was unreadable. I was able to discover that the files I was using as a basis for my test were not using the same MQPUT as MQGET. The MQPUT was using MQPUTX and the MQGET was using MQGETAny.
When I changed the MQGET call to use MQGETX I was able to read the retrieved message.
Thank You all for your help. |
|
Back to top |
|
 |
|