We help IT Professionals succeed at work.

Creating MSMQ Triggers

1,617 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?
Comment
Watch Question

Can you give us "more" details about what you intend to achieve by using thse MSMQ triggers?

Author

Commented:
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).
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.

Author

Commented:
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
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.

Author

Commented:
wow, do you have any links or do I just google object pooling?
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

Author

Commented:
ok, can this listener also be accomplished with .net 2.0 with the same results??
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.