Search code examples
.nettriggersmessage-queuemsmqwindows-server-2012

MSMQ Trigger EXE is not executing


Our MSMQ 6.3.9600 is on Win Server 2012 R2 Standard. Message Queuing, Message Queuing Triggers And Directory Services Integration were installed. Both Message Queuing and Message Queuing Triggers services are running under "Network Service".

We created a nontransactional Public Queue (say called Test). In Test > Property - Security, I have given NETWORK SERVICE "Full Control" that includes Receive Message, Peek Message, etc.

Test Queue has a Trigger with: -1 Rule called TestRule -Queue Path Name: myServer\Test -Enabled: Yes -Serialized: No -Message Processing Type: Message Peeking

TestRule: -Rule Condition: Message label does not contain "@@@@@@@@@@@@@@@@" -Rule Action: Invoke standalone executable (EXE) C:\myFolder\myProgram.exe. This VB.NET program is written with .NET Framework 4.0. Parameters: Invocation parameters: Message ID (as variant)

In Windows Explorer on myProgram.exe Property > Security, I also gave NETWORK SERVICE "Full Control" to the program and its folder.

When I send messages to Test Queue (and I see those messages in the Test Queue), I see myProgram.exe in Task Manager, but it's not executed. The Message label definitely does not contain "@@@@@@@@@@@@@@@@", so the trigger condition should be satisfied. In myProgram.exe Form_Load I immediately write to a log file, and I don't see that log file got created. I also try to write messages to event viewer, and I don't see those messages in event viewer.

I can run myProgram.exe manually (either dbl clicking on the exe or from "run"), and it runs fine.

I restarted Message Queuing service (that in turns also starts Message Queuing Triggers service), but myProgram.exe is still not executed.

The same setup works on another 2 of our servers (myProgram.exe is fired and executed on the other 2 servers), it's just not working on this 1 server.

Is there anything else that I need to check ? Thank you.


Solution

  • If you can see myProgram.exe in Task Manager then the trigger has worked and the application has been executed. The problem is likely to be that your application doesn't have the permissions to do whatever it wants to do as you can make it work when loaded in the context of the logged on user.