Pergunta

I am new to MSMQ and have this simple doubt. How to replace a message into msmq in case of an exception occurring in the handling code. I am using MSMQ with WCF and working on this example: http://www.codeproject.com/Articles/34168/WCF-Queued-Messaging

The client sends the message to the request queue and the server reads it and sends response to response queue. As per my knowledge, when the server is up and running it will read messages from queue and processes it. In my case I need to replace the message read from the request queue back, so that it can be processed again. How can I achieve this?

Here is the server method (configured as a wcf service with netMsmqBinding)that client calls:

    public void SendCreditLimitRequest(string id)
    {
        // process id
       // In case of exception "id" should reenter the queue     
    }
Foi útil?

Solução

You need to enable DTC on you message Queue and use transaction scope on your code.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top