1

I would like to use MSMQ queue to handle a lot of operations on XML data files. If I properly understand that technology, tasks will be passed to queue where they will get by handler. Also if there are a lot of such tasks, handler will catch tasks one by one. Therefore there are some pending tasks that just laying in queue and waits for handler.

So also I should show a progress of handling of uploaded XML files on website in percents. The question is how can I demonstrate such progress of pending tasks which really didn't start to be handled.

POST EDIT

The regular way of reflecting a progress of handling some task is to request service back for a percentage of completeness by some token, which client was generated before. And then just write it on the site.

tom redfern
  • 30,562
  • 14
  • 91
  • 126
kseen
  • 359
  • 8
  • 56
  • 104

1 Answers1

0

You can open a queue as bi-directional and let the handler pass an answer back to the sender.

MSMQ is ment to be used by a different process that can be run on even a different computer. This a way to offload long running jobs off the current process, as for example a service.

If that service is down, your client will not know about it, it even shouldn't care as MSMQ "guarantees" the job will be done. Consider how much use tracking progress is in that case? (besides observing that the service could be dead)

If you just to want to do some simple async work I suggest to look at the Task class and leave MSMQ.

lboshuizen
  • 2,746
  • 17
  • 20
  • You really should participate in another one my question [here](http://stackoverflow.com/questions/12836060/articles-on-how-to-organize-background-queue-operations). Actually there is a really need to offload site process and make a heavy work in another process. Let make some discussion in above question :) – kseen Oct 15 '12 at 17:06
  • Can you use/access a (shared) RDBMS? – lboshuizen Oct 15 '12 at 17:35
  • The client (web site) of MSMQ queue should also make a record in RDBMS. The comsumer of queue (WCF service that takes a messages from queue and handles data) just computes an data and that it is. – kseen Oct 15 '12 at 17:38
  • How do you *open a queue as bi-directional*? MSMQ is truly asynchronous. This sentence as it stands makes zero sense. There is no built-in duplex or bi-directional binding for MSMQ. – tom redfern Oct 16 '12 at 07:11
  • @hugh May be lboshuizen meant create own implementation of queue instead of using MSMQ? – kseen Oct 16 '12 at 08:31
  • Not creating a new implementation of a queue, but you can make use the journaling in msmq. – lboshuizen Oct 17 '12 at 15:35