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 Discussion » .NET struct for MQTMC2 in WebSphere MQ 5.2 and greater

Post new topic  Reply to topic
 .NET struct for MQTMC2 in WebSphere MQ 5.2 and greater « View previous topic :: View next topic » 
Author Message
cvrachak
PostPosted: Wed Feb 18, 2004 3:41 pm    Post subject: .NET struct for MQTMC2 in WebSphere MQ 5.2 and greater Reply with quote

Novice

Joined: 06 Jul 2002
Posts: 17

Hi All,

in the .NET classes for WebSphere MQ what is the equivalient structure of MQTMC2. I am planning to use the Trigger Monitor from IBM which will start my application. but I couldn't get a .NET structure similar to MQTMC2 in VC++. Could someone help me know how can my application know which Queue Manager + Queue Name was the trigger raised on?

Thanks in Advance
Chandra Sekhar
Back to top
View user's profile Send private message
JasonE
PostPosted: Thu Feb 19, 2004 2:10 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

The .net interface doesnt provide such an interface (neither does Java?) and hence you will need to do it yourself. The structure isnt 'complex' but its something like (Untested...)

public MQTrigger(string mqtmc2)
{
if (null == mqtmc2 || SIZEOF_MQTMC2 != mqtmc2.Length)
throw new Exception("Invalid MQTMC2 Structure");

MemoryStream memoryStream = new MemoryStream();
BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
BinaryReader binaryReader = new BinaryReader(memoryStream);

binaryWriter.Write(mqtmc2.ToCharArray(0, mqtmc2.Length)); // Write Trigger Data to struct
memoryStream.Seek(0, SeekOrigin.Begin); // Seek to begining of stream

trig.strucId = binaryReader.ReadBytes(4); // Struct ID
trig.version = binaryReader.ReadBytes(4); // Struct Version
trig.qName = binaryReader.ReadBytes(4; // Queue Name
trig.processName = binaryReader.ReadBytes(4; // Process Name
trig.triggerData = binaryReader.ReadBytes(64); // Trigger Data
trig.applType = binaryReader.ReadBytes(4); // Application Type
trig.applId = binaryReader.ReadBytes(256); // Application Identifier
trig.envData = binaryReader.ReadBytes(128); // Environment Data
trig.userData = binaryReader.ReadBytes(128); // User Data
trig.qMgrName = binaryReader.ReadBytes(4; // Queue Manager Name
}
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 Discussion » .NET struct for MQTMC2 in WebSphere MQ 5.2 and greater
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.