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 » MA7K: WebSphere MQ for Windows - Trigger monitor service

Post new topic  Reply to topic
 MA7K: WebSphere MQ for Windows - Trigger monitor service « View previous topic :: View next topic » 
Author Message
rajesh.palled
PostPosted: Fri Sep 06, 2013 12:08 pm    Post subject: MA7K: WebSphere MQ for Windows - Trigger monitor service Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 30
Location: New Jersey

Hi All,

Having trouble with parsing the TMC2 trigger message in .NET code.

I installed the MA7K (latest version - http://www-01.ibm.com/support/docview.wss?uid=swg24000149) on developer server to trigger one of their .NET exe.

Developer wanted to parse the trigger message he is getting in to his triggered application. but he is unable to get the queue name.

Anyone has a code in .NET on how to parse TMC2 trigger message so that i can pass it to the development team?

This is the trigger message i see in windows events - (replaced the extra tab spaces within message while posting here)

Starting: START "" /B "D:\MessageReceiver.exe" "TMC 2EXAMPLE.REQ EXAMPLE.REQ START "" /B "D:\MessageReceiver.exe" EXAMPLEQMGR "


EXAMPLE.REQ is the queue name developer wants to extract.
EXAMPLEQMGR is the queue manager they are connecting to.

This is what received by .NET application
“TMC 2EXAMPLE.REQ EXAMPLE.REQ START " /B D:\MessageReceiver.exe

Here is the code our developer is using for extracting queue name

MQTrigger mqtm = new MQTrigger(args[0]);
string queueName = mqtm.QueueName.Trim();

and it splits out an error "Invalid MQTMC2 Structure" because length of the argument is 729 whereas the dll which extracts the queue name out of it expects the length to be 732


Thanks
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Sep 07, 2013 6:30 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

The 732 length seems to be good. However you need to be extra careful when passing the arguments on the command line. Especially with trailing blanks... or paired quotes...

There seems to be some problem with paired quotes or some quotes might need to be escaped?

Code:
START "" /B "D:\MessageReceiver.exe" "TMC 2EXAMPLE.REQ EXAMPLE.REQ START "" /B "D:\MessageReceiver.exe" EXAMPLEQMGR "

Should maybe look more like:

start /b d:\messagereceiver.exe '<TMC2 comes here>'


It looks like you used double quotes in the definition of the process...

This can mess with the start / end of field (TMC2) double quotes.
Using single quotes for this can potentially alleviate this.
Or try not using any quotes in the process definition using progra~1 like syntax for your path...

Ideally the triggered program should read the qmgr name out of the TCM2 and not require it to be passed on the command line...

Have you looked at the windows support pack for triggering and at its documentation?


_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Sun Sep 08, 2013 9:35 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Yeah, there does appear to be a note in the ma7k readme
Quote:

*** There is a known problem if the "applicid" has blanks in the path.
This is currently due to a restriction in NT and hopefully can be
fixed sometime in the future. Use the DOS shortname for the directory
instead, which you can determine with "DIR /x". So, if the directory
name is:

"c:\spaces and blanks\executable.exe"

dir /x might show:

10/03/2001 09:07a <DIR> SPACES~1 SPACES AND BLANKS

and therefoer make the applicid:

applicid('c:\spaces~1\executable.exe')


I'll see if there's something smart I can do to resolve that in the code.

Note also that MA7K builds it's own TMC2 - it should be still valid, but it's entirely possible that the format of a TMC2 has changed since this code was last adjusted. The string MA7K sends is built in the launchApplication method in trigsvc.cpp. This should allow you to figure out how to get at what you're looking for. You can also, of course, just change the code and recompile yourself.

If you have further issues, please contact me using the information that ships with MA7K.
Back to top
View user's profile Send private message
rajesh.palled
PostPosted: Sun Sep 08, 2013 12:36 pm    Post subject: Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 30
Location: New Jersey

Thanks fjp_saper & jeff.

fjp points out my problem more clearly. Jeff, I dont have any single space in my path. It looks like the double quote that i used in the process definition is causing the TMC2 length cut off.

I will modify my process definition not to use double quote and will see if application gets what is needed for it.

This is what I have in my Process Definition now:
START """ /B "D:\MessageReceiver.exe"

I will update once i resolve this by removing double quote in process def.

Thanks
Back to top
View user's profile Send private message
rajesh.palled
PostPosted: Mon Sep 09, 2013 12:36 pm    Post subject: Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 30
Location: New Jersey

Just now I got the answer back from our developer. After removing the double quotes in the process name definition he is able to parse the TMC2 structure to get the queue name.

Process Definition ApplicID:
BEFORE:
START " " /B "D:\MessageReceiver.exe"

AFTER FIX:
D:\MessageReceiver.exe

Thanks Jeff & fjb_saper for your help.
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 » MA7K: WebSphere MQ for Windows - Trigger monitor service
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.