Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Transactional send & receive

$
0
0

Is it possible to perform a receive from one queue, and send to another within the same transaction? e.g.:

using (var tx = new TransactionScope())
{
    var inMsg = recv.Receive();
    var val = msg.GetBody<int>();
    var outMsg = new BrokeredMessage(val + 1);
    sender.Send(outMsg);
    inMsg.Complete();

    tx.Complete();
}

The above appears to give me an exception suggesting it isn't possible:

"The Transaction may have timed out or attempted to span multiple top-level entities such as Queue or Topic."

But surely this is a very common requirement? Is there a way around this?

(This is using Service Bus for Windows Server, if that makes a difference)


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>