Problems with MSMQ from Web Service

H

hamish

Hi,

Hope this is the correct place to post this query. What I am doing i think
is pretty simple. I have a web service that has a function that will insert a
message into a Queue, so that it can be processed by one of our backend
applications.

The code looks like this:

Dim oQueue As MessageQueue

If Not MessageQueue.Exists(".\myservice") Then

MessageQueue.Create(".\myservice", False)

End If

oQueue = New MessageQueue(".\myservice")

This all seems correct, except that the following happens. Whenever the
messagequeue.exists call is made, it brings back false, so it attempts to
create the message queue every time, which of course fails because the
message queue already exists. On the first run, it creates the queue (and the
queue can be seen in MMC), but it does not instantiate the oQueue object. It
fails with the Queue is not registered in DS error (or something similar).
The second time it runs, it obviously fails on the MessageQueue create call,
because the queue already exists.

I have searched and tried a few different solutions. Some include including
the machine name in the path, others were to add
FormatName:DIRECT=OS:.\MyService but all to no avail

Please help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top