?
Solved

Creating MSMQ Triggers

Posted on 2007-10-09
10
Medium Priority
?
1,508 Views
Last Modified: 2013-12-17
I am working with message queues and having a hard time wrapping my head around msmq triggers.  I want the receiving portion to be called for each message I send to the queue, processing time is about 1 second per message.  Which would be a better solution, a COM component or stand alone exe??  Whats the difference in the two approaches?
0
Comment
Question by:jhoop2002
  • 5
  • 4
9 Comments
 
LVL 21

Expert Comment

by:surajguptha
ID: 20046170
Can you give us "more" details about what you intend to achieve by using thse MSMQ triggers?
0
 
LVL 3

Author Comment

by:jhoop2002
ID: 20047748
Ok, let me try again.  Each and every time I submit a message to a queue I want something to happen.  From my understanding a trigger can call a COM component or .NET executable.  So if I submit 10 messages then a trigger gets fired 10 times, if I submit 100 messages the trigger gets fired 100 times.  

(from here when I say program I mean COM component or .NET executable)
The program that gets called will then process these messages.  I do not want to have the trigger wait for the program to finish processing the previous message before beginning to process the next.  I want the trigger to call another instance of the program (so I could have multiple instances of the program processing different messages).
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20048948
I would suggest you using a listenning application/ service instead of using the MSMQ triggers. Merely openning 100 instances for 100 messages may not be the right thing to do if your CPU had the power only to handle 4 messages. I would suggest the user of a listenner that would keep polling the queue for new messages.

0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 3

Author Comment

by:jhoop2002
ID: 20050743
well I was sorta hoping that I could have more than one message be processed at the same time.  As I understand the listener service it would only be able to process message 1 - wait - 2 - wait - 3 - wait
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20050762
well if you used like a windows service to pool the message using .net 3.0 for example you would be able to use object pooling that will control the number of messages to pick at a time. If you set it at 4, 4 messages will be picked up and processed in parallel by 4 instances of the service.
0
 
LVL 3

Author Comment

by:jhoop2002
ID: 20050793
wow, do you have any links or do I just google object pooling?
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20050853
Well if you just used a MSMQ listenner through .net 3.0 (WCF) you dont actually have to control the number of instances, the framework would pick as many messages as it can process.
Here is a link that will help you with setting up a MSMQ listenner using .net 3.0
http://msdn2.microsoft.com/en-us/library/ms752217.aspx

If you still wanted to do object pooling. Here is the info
http://msdn2.microsoft.com/en-us/library/ms751482.aspx
0
 
LVL 3

Author Comment

by:jhoop2002
ID: 20050905
ok, can this listener also be accomplished with .net 2.0 with the same results??
0
 
LVL 21

Accepted Solution

by:
surajguptha earned 2000 total points
ID: 20051001
An article to read messages from MSMQ using .net 2.0
http://www.codeproject.com/csharp/mgpmyqueue.asp
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Steps to fix “Unable to mount database. (hr=0x80004005, ec=1108)”.
Web hosting control panels were first developed to make it faster and easier for most users to set up and operate websites. The graphical user interface (GUI) allows users to perform tasks by pointing and clicking rather than typing highly specific…
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Suggested Courses

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question