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 Index » General IBM MQ Support » Accessing version 2 messages from a z/OS server using C#

Post new topic  Reply to topic
 Accessing version 2 messages from a z/OS server using C# « View previous topic :: View next topic » 
Author Message
joehuber
PostPosted: Fri Oct 08, 2004 11:43 am    Post subject: Accessing version 2 messages from a z/OS server using C# Reply with quote

Newbie

Joined: 08 Oct 2004
Posts: 7

I have a problem retrieving version 2 messages from a message queue on a z/OS MQ server. My application is written in C# and runs on Windows XP.

I have successfully used the application to retrieve version 2 formatted messages from a Windows MQ Server (I need version 2 because I need access to the Group Id). But when I point to a queue on the mainframe the MQMD always indicates the message is version 1 and has a 0 group id. I know that the message on the mainframe does, in fact, have version 2 information in it.

I am using the IBM MQ .NET wrapper classes. Below I have a sample of my code that uses the IBM.WMQ.MQMessage and IBM.WMQ.MQGetMessageOptions classes.

mqMsg = new MQMessage();
mqMsg.Format = MQC.MQFMT_STRING;

// Set the get message options
mqGetMsgOpts = new MQGetMessageOptions();
mqGetMsgOpts.WaitInterval = messageWaitMilliseconds;
mqGetMsgOpts.Options |= MQC.MQGMO_CONVERT;
mqGetMsgOpts.Options |= MQC.MQGMO_WAIT;
mqGetMsgOpts.Options |= MQC.MQGMO_SYNCPOINT;
mqGetMsgOpts.Options |= MQC.MQGMO_ALL_MSGS_AVAILABLE;

mqGetMsgOpts.Version = MQC.MQGMO_CURRENT_VERSION;
mqGetMsgOpts.MatchOptions = MQC.MQMO_NONE;


Note thtat I have also used MQC.MQGMO_VERSION_2 as the Version value and it made no difference.

I then get a message with the call:

mqQueue.Get( mqMsg, mqGetMsgOpts );

When the message returns the mqMsg instance has the group id set to all 0 and the mqGetMsgOpts instance has the group status set to not in a group. All the version 1 info is there such as the message id.

Do you see anything that I could be doing wrong? Remember that it works getting data from a queue on a Windows server but not from a queue on a z/OS server.

Do you know of any circumstances that would cause a version 2 message on the queue to return only version 1 data in the MQMD even though I am requesting version 2 within the GetMessageOptions?

Any help would be much appreciated (as I am pretty much stuck right now)!

Thanks,

Joe Huber
Back to top
View user's profile Send private message
EddieA
PostPosted: Fri Oct 08, 2004 12:36 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Quote:
But when I point to a queue on the mainframe the MQMD always indicates the message is version 1

This is because the MQMD you have defined in your program is set with Version 1.

From the depths of my memory, when I was at a previous client, I think they had exactly the same problem. (if not, it was very similar). The documentation implies that a Version 2 MQMD is used, but it isn't. You need to explicitly force the MQMD to a Version 2. Unfortunatley, I'm not a C (C++ or .NET) programmer, so I'm not too sure about the correct way of doing it.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
joehuber
PostPosted: Fri Oct 08, 2004 12:41 pm    Post subject: MQMD Version changing Reply with quote

Newbie

Joined: 08 Oct 2004
Posts: 7

Eddie,

Thanks for the reply. There is a version variable on the MQMessage class (independent of the version variable on the GetMessageOptions class). However, it is read-only. I guess I need more insight into the wrapper classes that IBM provides.

Does anyone have any more knowledge about the IBM provided .NET wrapper classes?

Thanks,

Joe
Back to top
View user's profile Send private message
kirani
PostPosted: Fri Oct 08, 2004 2:59 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

I thought your post will get lost in the General Discussion forum, so I moved it to General MQ Support forum.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
joehuber
PostPosted: Mon Oct 11, 2004 4:38 am    Post subject: I found the anwser! Reply with quote

Newbie

Joined: 08 Oct 2004
Posts: 7

Thanks Kirani.

Amazing what a weekend of rest can do. First thing this morning I set about finding out how to set the MQMD version to 2 (remember I said I was setting the GetMessageOptions version to 2 but couldn't set the MQMessage version to 2 because it was read-only in the IBM provided MQMessage class). I found the ability to set MessageFlags on the MQMessage and there I was able to set MQMD_VERSION_2. And I then got a version 2 message back!!! I got farther in my process but still experienced a problem. However, now I think it is just a matter of getting the right flags set.

I appreciate everyones help. The one thing I could still use some help with is documentation. The IBM MQ .NET wrapper classes are basically undocumented (the help file is no better than the object browser). Is there documentation somewhere about these classes on the internet? A link would be much appreciated.

Thanks,

Joe
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 11, 2004 4:45 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://www.mqseries.net/phpBB2/viewtopic.php?p=73572#73572
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JasonE
PostPosted: Mon Oct 11, 2004 4:46 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

FYI the MD version is set to the lowest required to handle the api call you are making.

The Version field of the GetMessageOptions does appear to be publically changable, and as far as I can see would go into the api call.

You were after the groupid, part of the MQMessage object - This is returned from the server following the get, and as far as I can tell from a quick browse, is the copied from md returned from the get call, along with the version field.

Are you running server or client bindings. Take a trace, and look at the MD coming back from the MQGET

(If server : Search for the trace with your process name in the first 4 lines, then search that trace for " MQGET <<")

(If client : Search for " MQGET" and look backwards until you see a block of data which includes "MD ")

Paste the returned MD in here, or PM me a location I can ftp the traces + your source from and I'll take a look
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Accessing version 2 messages from a z/OS server using C#
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.