|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
  |
|
Quetion on MQSeries, triggers and .NET |
View previous topic :: View next topic |
Author |
Message
|
rivast_2001 |
Posted: Thu Aug 05, 2004 12:13 pm Post subject: Quetion on MQSeries, triggers and .NET |
|
|
 Novice
Joined: 14 Jul 2004 Posts: 15 Location: Mansfield, MA
|
Hello,
I am working on a project where we are using MQSeries as the main information transport mechanism. The project is comprise of 3 local queues (with trigger options enabled), 3 initiation queues, 3 processes, 3 trigger monitors and 4 applications ( 1 to initiate process and 3 to respond the trigger invocations). Here is how everything is supposed to work,
1. Application A1 writes an entry to queue Q1
2. Due to Q1 has defined triggering capabilities at *FIRST to use process P1, it shows a message on the initiation queue IQ1.
3. The monitor program MP1 detects the message and invokes the second application A2.
4. A2 reads Q1 until no more entries are found. Its main functionality is to transforms an XML document contained in the message and post a new version of the message on the second queue, Q2.
5. Due to Q2 has defined triggering capabilities at *FIRST to use process P2, it shows a message on the initiation queue IQ2.
6. The monitor program MP2 detects the message and invokes the third application A3.
7. A3 reads Q2 until no more entries are found. Its main functionality is to transform this message into a business object and save it to a SQL database. Once it is done it posts an entry into the third queue Q3.
8. Due to Q3 has defined triggering capabilities at *FIRST to use process P3, it shows a message on the initiation queue IQ3.
9. The monitor program MP2 detects the message and invokes the third application A4.
10. A4 reads Q3 until no more entries are found and sends confirmations via e-mail.
A1, A4 – iSeries application
A2, A3 – Windows application
MP1 – iSeries Monitor program, created with the MQSeries commands
MP2, MP3 – Windows Services that monitor the initiation queues. They were setup using the MA7K: WebSphere MQ for Windows 2000 - Trigger monitor service
Everything looks to talk to each end with no problem, but in an effort to verify that the right events were being triggered to every initiation queue I decided to put the monitor program in the iSeries on HOLD and PAUSED the NT services. I noticed that when A1 was closing the queue, “a new entry was being added to the IQ1”. How could the application that answered the trigger write an entry to the initiation queue, or to the original queue that could cause a trigger event to occur?
This is the code that is causing the new entry to appear. The line with in RED is the one causing the issues.
public string GetMessageFromQueue(string inQueueName)
{
string outValue = "";
try
{
//checking if connection with _queue manager is active
CheckQueueManagerConnection();
if (GetMessageCount(inQueueName) > 0)
{
_queue = _qManager.AccessQueue(inQueueName, MQC.MQOO_INPUT_AS_Q_DEF);
//creating instance of the message
_getMessage = new MQMessage();
_getMessageOptions = new MQGetMessageOptions();
//this will allowed the program to use the GET method witouh matching
_getMessageOptions.MatchOptions = MQC.MQMO_NONE;
//getting the message
_queue.Get(_getMessage, _getMessageOptions);
//returning the string representation of the body of the message
outValue = _getMessage.ReadString(_getMessage.DataLength);
//closing the _queue
_qManager.Commit();
_queue.Close(); }
}
catch(Exception exc)
{
throw new Exception(
string.Format("Error when getting message from _queue \"{0}\".", inQueueName), exc);
}
return outValue;
} |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Aug 05, 2004 12:34 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
If you close a Triggered On First queue, and there are more than zero messages on that queue, and all other trigger conditions are still true, then the Queue Manager will create another Trigger Message to the Initiation Queue. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
rivast_2001 |
Posted: Thu Aug 05, 2004 2:09 pm Post subject: |
|
|
 Novice
Joined: 14 Jul 2004 Posts: 15 Location: Mansfield, MA
|
Thanks a lot for your inmediate answer.
Is there any way to reset a trigger in case I decide to use the *DEPTH 1 instead? I will be still using the amqmdnet.dll assembly. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Aug 05, 2004 2:22 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Just change the queue attribute to depth for triggering. Check out the MQSC manual on how to change all that. Its also pretty obvious thru the GUI.
I would not go to DEPTH though. Why do you want to do that? Are you aware of all the ramifications? Did you read the chapter on triggering in the APG manual? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
rivast_2001 |
Posted: Thu Aug 05, 2004 2:35 pm Post subject: |
|
|
 Novice
Joined: 14 Jul 2004 Posts: 15 Location: Mansfield, MA
|
Thanks a lot again. I checked all my routines and avoid closing the queues and everything is working fine at this moment. This site rocks!!!! |
|
Back to top |
|
 |
|
|
  |
|
Page 1 of 1 |
|
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
|
|
|
|