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 » 关于触发的

Post new topic  Reply to topic
 关于触发的 « View previous topic :: View next topic » 
Author Message
xincap
PostPosted: Tue Aug 22, 2006 1:43 am    Post subject: 关于触发的 Reply with quote

Newbie

Joined: 22 Aug 2006
Posts: 6

我对于MQ的消息触发机制不太明白,我的理解如下:
1.自己要写一个监控服务程序,实现监控消息队列指定的起动队列.
2.发现有触发器消息,取出来.
3.分析触发器消息,进行下一步工作(包括起动另外的程序).

是不是应该这样,请大家给予帮助!
最好能够提供c#例子,盼望中...

How to use MQTrigger message?
Put a message to a queue, QM create a trigger message and put it to the init_queue.
my problem is how to get the trigger message and process information!

somebody give me a favour?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
jefflowrey
PostPosted: Tue Aug 22, 2006 2:06 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The trigger message is passed to the triggered program as an MQTMC2 structure in the program arguments. At least, the default trigger monitors do this.

So you will have to access ARGV or whatever from your program to get the MQTMC2 structure, and then get the various information you need (queue name) from that.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
xincap
PostPosted: Wed Aug 23, 2006 1:53 am    Post subject: Another trigger message problem? Reply with quote

Newbie

Joined: 22 Aug 2006
Posts: 6

Thanks for your help!

I made a c# program to get the trigger message as a progress in MQ.
I opened a cmd window and run runmqtrm.exe, then put a message to local queue.Immediately,my c# program started automaticly and get the MQTMC2 struc data.I can get the full data and split it into 10 parts.
But I have another problems:
1. The sixth part of the 10 parts was null,I couldn't get the value(Windows NT);

2.I have to run runmqtrm.exe in a cmd windows,if I run it as a MQ serve,my c# program would run under the user MUSR_MQADMIN,I couldn't see the interface of my own program.How can I do?How can I change user or take other method?

3. If I give the MQ progress environment data,my c# program would get 2 argument parameter.The first is full string data,the second is the environment data. why? Another secret here?

My English is poor, I hope I expressed my means.
I hope you will give a reply here ,thanks!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
jefflowrey
PostPosted: Wed Aug 23, 2006 2:00 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I'd have to look up which one is the sixth field to figure out why it might show up as null. The MQTMC2 should always be a string, I think, and should always be one parameter on ARGV.

A triggered program always runs as the same user that is running the trigger monitor. I think you're right, that the MQ services don't allow you to specify what user the service starts and stops as - and so the trigger monitor would run as MUSER_MQADMIN.

There's nothing that prevents you from using any other mechanism to schedule a task to run the trigger monitor or create a service from any command, and set that to run as some particular user or another.

Or you could run your app in client mode and use the Windows Client Trigger Monitor Service.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
xincap
PostPosted: Thu Aug 24, 2006 1:24 am    Post subject: About MQTMC2 Reply with quote

Newbie

Joined: 22 Aug 2006
Posts: 6

Thanks, jefflowrey.
I made a my own trigger monitor using c#.(My environment :MQ6+WIN2003)

In my monitor program I only reference amqmdnet.dll .

I got the trigger message from init_queue:
//mes is a MQMessage object
string tri_mes;
tri_mes = mes.ReadString(mes.MessageLength);

result:
tri_mes.length is 684. It is MQTMC length,not MQTMC2, why ?
It should be 730. tri_mes had no qMgrName field.

I splitted tri_mes, and all fields were right data except version and appType.

version = "r\0\0\0"
appType = "\0\0\0"

I don't know how to explain this result.

Can you tell me?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
jefflowrey
PostPosted: Thu Aug 24, 2006 2:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

OH.

You wrote your own trigger monitor.

I thought you were writing a triggered program.

Why did you decide to write your own trigger monitor?

Yes, the initiation message is an MQTMC structure, not an MQTMC2 structure.

One of the jobs of the trigger monitor is to read the initiation message which is the MQTMC structure, and then turn it into an MQTMC2 structure which gets passed to the triggered program.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
xincap
PostPosted: Fri Aug 25, 2006 12:17 am    Post subject: About trigger message Reply with quote

Newbie

Joined: 22 Aug 2006
Posts: 6

Thanks a lot! jefflowrey!

I wrote my own trigger monitor for my full controlling freely.

I have learned more about MQ from you!

I hope I can get your help in the future!

Thanks again!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » 关于触发的
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.