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>