I think you can just do a BeginPeek and check the correlationId against the
message you receive from the EndPeek. If it is [one of your outstanding]
message[s], then receiveByCorrelationId. If not, then ignore and BeginPeek
again. Sorry, I haven't worked with MSMQ in over a year, so the details are
a bit rusty, but I think that should work for you.
On 8/5/06, Paul Cowan <[EMAIL PROTECTED]> wrote:
Hi,
We are creating a web application that unfortunately has to communicate
with a product called Navision. The communication is to send and receive
xml documents via MSMQ.
The process is we send a message to one queue and receive messages on
another queue. The only reliable way I have been able to marry these
messages together is to by setting the CorrelationId of the response message
to be the id of the request message.So far I am doing this synchronously
using the ReceiveByCorrelationId method. I have grave worries of how this
will scale and I don't think it is thread safe.
My code is as follows:
while (receiveQ.PeekByCorrelationId(messageId, _timeOut) != null)
{
message = receiveQ.ReceiveByCorrelationId(messageId, _timeOut);
}
I would like to do this asynchronously but am really not sure how to go
about this.
Can anyone with MSMQ experience tell me how I can accomplish this problem
asynchronously??
Thanks
Paul
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at
http://discuss.develop.com
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com