tags:

views:

472

answers:

2

I've never used MSMQ before, but that's OK. Neither has anyone else in my company. But one of our product vendors uses it voraciously, yet cannot figure out what's wrong with our system. So, I'm figuring out as much MSMQ as it takes to get it on the road.

I've got a working and a non-working installation to start with. On neither system does the following script place a message in the queue. If I provide a valid FormatName the script throws no errors, presumably because it thinks it's successfully delivered the message. Perhaps there's some way I could read msmqlog.bin to find out what's really happening?

I'm lost as a ball in high weeds on this one. :-(

<Job ID="MQCopyT"> 
<?Job Debug="True"?>
<Reference Object="MSMQ.MSMQApplication"/>
<Script language="VBScript">

Option Explicit
Dim objArgs
Set objArgs = WScript.Arguments

if (objArgs.Count <> 1) Then
WScript.Echo "Usage: " + Wscript.ScriptName + " <Dest Queue>"
WScript.Quit
End If

Dim QIDest
Set QIDest = WScript.CreateObject("MSMQ.MSMQQueueInfo")
QIDest.FormatName = "DIRECT=OS:" & objArgs(0)
Dim QDest
Set QDest = QIDest.Open(MQ_SEND_ACCESS, MQ_DENY_NONE)

Dim mqmsg
Set mqmsg = CreateObject("MSMQ.MSMQMessage")  

'Set the body and label properties  
mqmsg.Body = "Data adventure" 
mqmsg.Label = "Data test"  

mqmsg.Send QDest


</script>
</job>
+1  A: 

Silent fails happen mostly when you send non-transitionally ( as you do here) to a transactional queue. Try creating a non-transactional queue and send to there.

Igal Serban
Thank you, Igal. I both scripted a transactional send to a transactional queue and a non-TX send to a non-TX queue. Everything is failing silently. The target for this script is non-TX.
codepoke
+2  A: 

Shot in the dark here, but check the permissions on your MSMQ. As a test, set full permissions for "Everyone" and then scale back if it works.

Clarence Klopfstein
My ignorance stands front and center here. I tried that early on, and get "The security descriptor cannot be set. Error: Access is denied." I had/have no clue whether that's an appropriate error message. It seemed odd to me that I could not set that security, but Everyone has send and receive privileges on the queue so I just went on. I've not been able to figure out where to look to give myself access to change access on queues.
codepoke
Yep. Administrators lacked full control. A number of queues have unexpected (to me) access restrictions, but once I got a Domain Admin to give Administrators Full Control, I could finally drop messages in a queue. Finally, I have somewhere to start. Thank you, Clarence.
codepoke
Glad I could help, I've fought MSMQ over and over again over permissions.
Clarence Klopfstein