ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexIBM MQ API SupportUnreadable Buffer data in MQGET using VB 6 in client connect

Post new topicReply to topic
Unreadable Buffer data in MQGET using VB 6 in client connect View previous topic :: View next topic
Author Message
sigolfer
PostPosted: Tue Dec 23, 2008 10:43 am Post subject: Unreadable Buffer data in MQGET using VB 6 in client connect Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue Dec 23, 2008 10:49 am Post subject: Re: Unreadable Buffer data in MQGET using VB 6 in client con Reply with quote

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
View user's profile Send private message
sigolfer
PostPosted: Tue Dec 23, 2008 11:03 am Post subject: Reply with quote

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
View user's profile Send private message
gbaddeley
PostPosted: Sat Dec 27, 2008 3:28 am Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Tue Dec 30, 2008 3:34 pm Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Wed Dec 31, 2008 12:26 am Post subject: Reply with quote

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
View user's profile Send private message
sigolfer
PostPosted: Wed Dec 31, 2008 12:01 pm Post subject: Unreadable Buffer data in MQGET using VB 6 in client connect Reply with quote

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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ API SupportUnreadable Buffer data in MQGET using VB 6 in client connect
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.