简体   繁体   中英

Can I check item in transactional msmq queue

I'm using transactional msmq queue. I need check items in queue and items what havn't been commited yet before add new item.

I can check all items in queue, but how I can check items that was dequeued, but still havn't been commited?

Updated: I have several slaves instances and one master server. Each slave can upload data (big files) to master and download new data from master.

Slaves register upload and download operations on master in msmq queue, and then start transaction, dequeue operations, do operation with big file, commit transaction if all right else rollback transaction.

I must reject all upload registrations until i'm sure that file completly uploaded, becouse several slaves don't have to upload one file at same time.

To me, this sounds more like an architectural problem of your client/ service structure than MSMQ related.

If I work with transaction on a database I would intuitively expect all clients to see any changes only after they were committed. In your scenario the MSMQ behaves just like I would expect it from a DBMS, too.

All in all, as far as I have understood your task, I think that you might be looking at the wrong spot . Consider tracking the uploads somewhere in the service . If you need to make sure that clients do not upload more than one file ata time you should implement this in there.

Your possible choices depend on your environment (which we do not know yet). You could use some kind of cache to manage the client connections, or you could use locks to synchronize the uploads, or configuring your service to only accept X connections, or...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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