简体   繁体   English

MSMQ 事务性或可恢复性

[英]MSMQ transactional or recoverable

I have a question about MSMQ.我有一个关于 MSMQ 的问题。 If I use a non-transactional queue and send message to it with recoverable parameter, message is stored on disc and in case of some problem secure.如果我使用非事务性队列并向其发送带有可恢复参数的消息,消息将存储在磁盘上,以防出现某些问题。 But if I want pull message from non-transactional queue, is there some mechanism to secure messages to stay in queue in case of some problem (server error, db off...)?但是,如果我想从非事务性队列中提取消息,是否有某种机制可以确保消息在出现问题(服务器错误、数据库关闭...)时保持在队列中?

For some reasons I don't want to use transactional queue.由于某些原因,我不想使用事务队列。 Thanks a lot for response.非常感谢您的回复。

You could implement a peek-then-receive process to simulate a transaction.您可以实现先查看然后接收过程来模拟交易。

  1. Peek message to get content.偷看消息以获取内容。
  2. Use the content as you wish.随意使用内容。
  3. If step 2 completes then Receive message to effectively delete it.如果第 2 步完成,则接收消息以有效删除它。
  4. If step 2 fails, execute cleanup code and goto step 1.如果第 2 步失败,则执行清理代码并转到第 1 步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM