I've created a WCF service to send a message to an MSMQ, I can get it to run and it looks like the message was sent but when looking at the queue it's not there. I've verified and the queue is not a transactional queue. Security is open so that everyone can send messages but I'm wondering if there are other places to set security? Here is my code I'm using.
Dim mq As MessageQueue
Dim msg As Message
Dim queueName As String = "webdevbvm.labsafety.com\emailsubscriptions"
Try
msg = New Message("Test")
msg.Priority = MessagePriority.Highest
If (MessageQueue.Exists(queueName)) Then
mq = New MessageQueue(queueName)
msg.ResponseQueue = mq
msg.UseJournalQueue = True
msg.Label = "Test Message"
msg.Body = "This is only a test"
mq.Send(msg)
Console.WriteLine("Message sent.")
End If
Catch ex As MessageQueueException
Console.WriteLine("MSMQ Error: " + ex.ToString())
Catch ex As Exception
Console.WriteLine("Error: " + ex.ToString())
Finally
mq.Close()
End Try
I get no errors but I do see the messages in my outgoing queue from the machine that is running the program. It shows the queue exists and if I change the queue name to one that doesn't exist it doesn't go into the IF statement so I know it's seeing the queue just not sending the file. If it helps I'm running the program locally on a laptop and the queue it's sending too is on a Windows 2003 server.