[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

David

10/28/2008 5:58:00 PM

Hi,

This question could be very subjective but I am after a way to design
this...

I am developing in C#, .NET 2.0

Basically, I have data coming in from a mobile phone. This is sending a file
to a webservice. The webservice will save the file to local disk and also
send / receive messages from the mobile phone. This part is working fine,
though wether I should have a multi-thread on this, I don't know.


Once the file has been saved, I need to then work on it. The process can
become quite intensive. Also, each file can come from a different customer
and each customer will have a 'priority' preference, for example, some files
have to be acted upon immediately (due to them being time critical) where
others that are not so critical can wait.


My thoughts to handle this is a windows service with a filewatcher to watch
the webservice receiving folder. Then, depending on the file (customer),
react to it...

I guess I should be doing threading here (I have not really done any
threading before...) but I do have to bear in mind priority files. Also, if
there are for example, 3 files from one phone, they have to be handled
chronologically.

We could be talking many thousands of files per day that need to be handled
(both for the webservice and windows service). Also, there could be varying
outputs, for example, some customers may just want a raw processed file
(XML), others may want an image while others may want a PDF. Also, any / all
of these could be selected.

Finally, the file can be delivered either back to the phone, via email, via
FTP, HTTP to another web server or any other common communications
technology. (Again, any / all options could be selected.)

I also have to make the application work on mulitple servers, though that
probably won't be such an issue unless I have a common fileserver to store
the incoming files and the filewatcher service on two servers both attempt
to collect the same file.

Ideas on how I should approach this would be very much appreciated.


--
Best regards,
Dave Colliver.
http://www.Ashfiel...
~~
http://www.FOCUSP... - Local franchises available


11 Answers

sloan

10/28/2008 6:22:00 PM

0


This is a deprecated application block, but you might draw some ideas from
it:

http://msdn.microsoft.com/en-us/library/ms9...


I would create WCF code, and expose it as a WebService.
http://sholliday.spaces.live.co...!A68482B9628A842A!158.entry
This would give you greater flexibility in the future.....instead of hard
coding up a WebService now.

.......

//> Finally, the file can be delivered either back to the phone, via email,
via
> FTP, HTTP to another web server or any other common communications
> technology. (Again, any / all options could be selected.)//

Do you have to send them the file? Or can you send them a link (http url)
to the file?

We have a scenario for reports. The person would request a report.
Sometimes it took 20 minutes to create it.
We'd send them a link to the (final output) as a URL.

I would also use the "double guid" system for filenames.

string directoryName = Guid.NewGuid().ToString("N");
string fileName = Guid.NewGuid().ToString("N");
string ext = ".xml";

string physicalFullName = "C:\inetpub\wwwroot\" + directoryName + "\" +
fileName + ext);
string urlName = "http://mymachine/" + directoryName + fileName + ext;

File.Save (physicalFullName ); // pseudo code

Email.Send ("You have a file waiting for you at: " + urlName );// pseudo
code




"David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
news:uJyGYbSOJHA.4372@TK2MSFTNGP04.phx.gbl...
> Hi,
>
> This question could be very subjective but I am after a way to design
> this...
>
> I am developing in C#, .NET 2.0
>
> Basically, I have data coming in from a mobile phone. This is sending a
> file to a webservice. The webservice will save the file to local disk and
> also send / receive messages from the mobile phone. This part is working
> fine, though wether I should have a multi-thread on this, I don't know.
>
>
> Once the file has been saved, I need to then work on it. The process can
> become quite intensive. Also, each file can come from a different customer
> and each customer will have a 'priority' preference, for example, some
> files have to be acted upon immediately (due to them being time critical)
> where others that are not so critical can wait.
>
>
> My thoughts to handle this is a windows service with a filewatcher to
> watch the webservice receiving folder. Then, depending on the file
> (customer), react to it...
>
> I guess I should be doing threading here (I have not really done any
> threading before...) but I do have to bear in mind priority files. Also,
> if there are for example, 3 files from one phone, they have to be handled
> chronologically.
>
> We could be talking many thousands of files per day that need to be
> handled (both for the webservice and windows service). Also, there could
> be varying outputs, for example, some customers may just want a raw
> processed file (XML), others may want an image while others may want a
> PDF. Also, any / all of these could be selected.
>
> Finally, the file can be delivered either back to the phone, via email,
> via FTP, HTTP to another web server or any other common communications
> technology. (Again, any / all options could be selected.)
>
> I also have to make the application work on mulitple servers, though that
> probably won't be such an issue unless I have a common fileserver to store
> the incoming files and the filewatcher service on two servers both attempt
> to collect the same file.
>
> Ideas on how I should approach this would be very much appreciated.
>
>
> --
> Best regards,
> Dave Colliver.
> http://www.Ashfiel...
> ~~
> http://www.FOCUSP... - Local franchises available
>


Peter Duniho

10/28/2008 6:22:00 PM

0

On Tue, 28 Oct 2008 10:58:18 -0700, David
<david.colliver.NEWS@revilloc.removethis.com> wrote:

> [...]
> Once the file has been saved, I need to then work on it. The process can
> become quite intensive. Also, each file can come from a different
> customer
> and each customer will have a 'priority' preference, for example, some
> files
> have to be acted upon immediately (due to them being time critical) where
> others that are not so critical can wait.
>
> My thoughts to handle this is a windows service with a filewatcher to
> watch
> the webservice receiving folder. Then, depending on the file (customer),
> react to it...
>
> I guess I should be doing threading here (I have not really done any
> threading before...) but I do have to bear in mind priority files. Also,
> if
> there are for example, 3 files from one phone, they have to be handled
> chronologically.
>
> [...]
> Ideas on how I should approach this would be very much appreciated.

The question is very broad, and this is probably not the best forum for a
deep discussion about your options.

That said, some thoughts about what you've posted:

-- Don't use FileSystemWatcher unless you really have to. It's a
useful class in certain scenarios, but it isn't 100% reliable. If file
system changes happen too rapidly for your own code to keep up,
notifications may be discarded. It's extra work to make it reliable --
basically you wind up having to do your own scans to double-check that you
haven't missed anything -- and if you do that, then the apparent
simplicity of using FileSystemWatcher winds up negated.

Since you appear to have control over the code that's receiving the files,
you will be much better off just managing your own queue of work based on
what files you know you've received, rather than relying on the file
system as your mediator between code modules.

-- The prioritization feature has the potential for really causing
problems. It's not really clear from your description what prioritization
would be used, but hopefully it's something relatively simple. If it's
okay for starvation to occur, then a simple ordered queue is probably a
good bet. One thing you're vague about is whether priorities are for
manging files for a specific user only, or whether users themselves have
individual priorities that affect which user's files get processed first.

A possible fallback to you implementing all the prioritization logic
yourself would be to dedicate individual threads to each priority class
you have, setting the thread priorities appropriately. I almost always
recommend _against_ setting thread priorities, but in this case, as long
as you can categorize your priorities in a reasonably few number of
groups, it might actually work in your favor to set the thread priorities
and then let Windows do the heavy lifting for you. Its thread scheduler
has lots of little details in it to ensure that prioritization happens
correctly without starving work and while maintaining a consistent flow.

Other than that, I'd say that without a much more detailed description of
your architecture,it would be difficult or impossible to offer any really
useful design advice.

Pete

Patrice

10/29/2008 10:26:00 AM

0

As files are submitted by using a web service I would add them to a
processing at this point rather than just using the file system. This way
you can add whatever you want to each entry (either priority, chronological
time, current status, and even try to reprocess in case of a failure).

Similary it should be easier to use multiple threads if needed this
way...(i.e. basically you just share reading/setting the current status).

--
Patrice

"David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
message de groupe de discussion : uJyGYbSOJHA.4372@TK2MSFTNGP04.phx.gbl...
> Hi,
>
> This question could be very subjective but I am after a way to design
> this...
>
> I am developing in C#, .NET 2.0
>
> Basically, I have data coming in from a mobile phone. This is sending a
> file to a webservice. The webservice will save the file to local disk and
> also send / receive messages from the mobile phone. This part is working
> fine, though wether I should have a multi-thread on this, I don't know.
>
>
> Once the file has been saved, I need to then work on it. The process can
> become quite intensive. Also, each file can come from a different customer
> and each customer will have a 'priority' preference, for example, some
> files have to be acted upon immediately (due to them being time critical)
> where others that are not so critical can wait.
>
>
> My thoughts to handle this is a windows service with a filewatcher to
> watch the webservice receiving folder. Then, depending on the file
> (customer), react to it...
>
> I guess I should be doing threading here (I have not really done any
> threading before...) but I do have to bear in mind priority files. Also,
> if there are for example, 3 files from one phone, they have to be handled
> chronologically.
>
> We could be talking many thousands of files per day that need to be
> handled (both for the webservice and windows service). Also, there could
> be varying outputs, for example, some customers may just want a raw
> processed file (XML), others may want an image while others may want a
> PDF. Also, any / all of these could be selected.
>
> Finally, the file can be delivered either back to the phone, via email,
> via FTP, HTTP to another web server or any other common communications
> technology. (Again, any / all options could be selected.)
>
> I also have to make the application work on mulitple servers, though that
> probably won't be such an issue unless I have a common fileserver to store
> the incoming files and the filewatcher service on two servers both attempt
> to collect the same file.
>
> Ideas on how I should approach this would be very much appreciated.
>
>
> --
> Best regards,
> Dave Colliver.
> http://www.Ashfiel...
> ~~
> http://www.FOCUSP... - Local franchises available
>

David

10/29/2008 12:17:00 PM

0

Hi,

Thanks Sloan, Peter and Patrice. Definately food for thought.

Patrice, can you expand on what you mean?


The system has to work with a plugin architecture and be scalable. For
example, it will also be database driven and I need to be able to use
different databases. This I can easily achieve by using a layered approach,
something I haven't mentioned yet though is that it has to be able to work
from a clustered perspective as well (such as a clustered DB server or
clustered web server etc.) However, I don't think that affects this part of
the structure.


--
Best regards,
Dave Colliver.
http://www.Ashfiel...
~~
http://www.FOCUSP... - Local franchises available


"Patrice" <http://www.chez.com/s... wrote in message
news:DD4305A1-614E-44FB-BA1B-59CC117C006D@microsoft.com...
> As files are submitted by using a web service I would add them to a
> processing at this point rather than just using the file system. This way
> you can add whatever you want to each entry (either priority,
> chronological time, current status, and even try to reprocess in case of a
> failure).
>
> Similary it should be easier to use multiple threads if needed this
> way...(i.e. basically you just share reading/setting the current status).
>
> --
> Patrice
>
> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
> message de groupe de discussion : uJyGYbSOJHA.4372@TK2MSFTNGP04.phx.gbl...
>> Hi,
>>
>> This question could be very subjective but I am after a way to design
>> this...
>>
>> I am developing in C#, .NET 2.0
>>
>> Basically, I have data coming in from a mobile phone. This is sending a
>> file to a webservice. The webservice will save the file to local disk and
>> also send / receive messages from the mobile phone. This part is working
>> fine, though wether I should have a multi-thread on this, I don't know.
>>
>>
>> Once the file has been saved, I need to then work on it. The process can
>> become quite intensive. Also, each file can come from a different
>> customer and each customer will have a 'priority' preference, for
>> example, some files have to be acted upon immediately (due to them being
>> time critical) where others that are not so critical can wait.
>>
>>
>> My thoughts to handle this is a windows service with a filewatcher to
>> watch the webservice receiving folder. Then, depending on the file
>> (customer), react to it...
>>
>> I guess I should be doing threading here (I have not really done any
>> threading before...) but I do have to bear in mind priority files. Also,
>> if there are for example, 3 files from one phone, they have to be handled
>> chronologically.
>>
>> We could be talking many thousands of files per day that need to be
>> handled (both for the webservice and windows service). Also, there could
>> be varying outputs, for example, some customers may just want a raw
>> processed file (XML), others may want an image while others may want a
>> PDF. Also, any / all of these could be selected.
>>
>> Finally, the file can be delivered either back to the phone, via email,
>> via FTP, HTTP to another web server or any other common communications
>> technology. (Again, any / all options could be selected.)
>>
>> I also have to make the application work on mulitple servers, though that
>> probably won't be such an issue unless I have a common fileserver to
>> store the incoming files and the filewatcher service on two servers both
>> attempt to collect the same file.
>>
>> Ideas on how I should approach this would be very much appreciated.
>>
>>
>> --
>> Best regards,
>> Dave Colliver.
>> http://www.Ashfiel...
>> ~~
>> http://www.FOCUSP... - Local franchises available
>>
>


Patrice

10/29/2008 1:03:00 PM

0

Same as Peter, I meant I would add them a processing queue (this is the word
I omitted) or even queues (for example depending on priority) . In addition
to the pure technical difference between a file system watcher and a queue,
I feel it would allow to store some additional data that could help in
managing each entry.

It should be quite easy to do a mock up to simulate the base principle you
would use...

--
Patrice

"David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
message de groupe de discussion : O1dGeBcOJHA.1744@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> Thanks Sloan, Peter and Patrice. Definately food for thought.
>
> Patrice, can you expand on what you mean?
>
>
> The system has to work with a plugin architecture and be scalable. For
> example, it will also be database driven and I need to be able to use
> different databases. This I can easily achieve by using a layered
> approach, something I haven't mentioned yet though is that it has to be
> able to work from a clustered perspective as well (such as a clustered DB
> server or clustered web server etc.) However, I don't think that affects
> this part of the structure.
>
>
> --
> Best regards,
> Dave Colliver.
> http://www.Ashfiel...
> ~~
> http://www.FOCUSP... - Local franchises available
>
>
> "Patrice" <http://www.chez.com/s... wrote in message
> news:DD4305A1-614E-44FB-BA1B-59CC117C006D@microsoft.com...
>> As files are submitted by using a web service I would add them to a
>> processing at this point rather than just using the file system. This way
>> you can add whatever you want to each entry (either priority,
>> chronological time, current status, and even try to reprocess in case of
>> a failure).
>>
>> Similary it should be easier to use multiple threads if needed this
>> way...(i.e. basically you just share reading/setting the current status).
>>
>> --
>> Patrice
>>
>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
>> message de groupe de discussion :
>> uJyGYbSOJHA.4372@TK2MSFTNGP04.phx.gbl...
>>> Hi,
>>>
>>> This question could be very subjective but I am after a way to design
>>> this...
>>>
>>> I am developing in C#, .NET 2.0
>>>
>>> Basically, I have data coming in from a mobile phone. This is sending a
>>> file to a webservice. The webservice will save the file to local disk
>>> and also send / receive messages from the mobile phone. This part is
>>> working fine, though wether I should have a multi-thread on this, I
>>> don't know.
>>>
>>>
>>> Once the file has been saved, I need to then work on it. The process can
>>> become quite intensive. Also, each file can come from a different
>>> customer and each customer will have a 'priority' preference, for
>>> example, some files have to be acted upon immediately (due to them being
>>> time critical) where others that are not so critical can wait.
>>>
>>>
>>> My thoughts to handle this is a windows service with a filewatcher to
>>> watch the webservice receiving folder. Then, depending on the file
>>> (customer), react to it...
>>>
>>> I guess I should be doing threading here (I have not really done any
>>> threading before...) but I do have to bear in mind priority files. Also,
>>> if there are for example, 3 files from one phone, they have to be
>>> handled chronologically.
>>>
>>> We could be talking many thousands of files per day that need to be
>>> handled (both for the webservice and windows service). Also, there could
>>> be varying outputs, for example, some customers may just want a raw
>>> processed file (XML), others may want an image while others may want a
>>> PDF. Also, any / all of these could be selected.
>>>
>>> Finally, the file can be delivered either back to the phone, via email,
>>> via FTP, HTTP to another web server or any other common communications
>>> technology. (Again, any / all options could be selected.)
>>>
>>> I also have to make the application work on mulitple servers, though
>>> that probably won't be such an issue unless I have a common fileserver
>>> to store the incoming files and the filewatcher service on two servers
>>> both attempt to collect the same file.
>>>
>>> Ideas on how I should approach this would be very much appreciated.
>>>
>>>
>>> --
>>> Best regards,
>>> Dave Colliver.
>>> http://www.Ashfiel...
>>> ~~
>>> http://www.FOCUSP... - Local franchises available
>>>
>>
>
>

Bill D

10/29/2008 1:43:00 PM

0

This could add a whole new level of complication to your system, but we
handled a similiar priority requirement using a messaging system. In out case
we used SQL Server's Service Broker, but I'm sure what we did could be
replicated with anyone. We have 2 queues, one is a low priority queue and has
one reader (think thread) at the end of it. The other is a high priority
queue and has several readers at the end so that it can process more data.
The application must determine which messages are high and low priority, but
after that most of the multi threading aspect is handled by the messaging
system. This also allows us to dynamically increase out processing
capabilities when the need arises by increasing the number of readers on the
queue. Another benefit of this is that the messages are garaunteed to be
delivered once they are in the queue.
On the other hand in an environment that does not already use messaging
this introduces allot of new pieces that can and will break and will need to
be monitored.

Bill

"Peter Duniho" wrote:

> On Tue, 28 Oct 2008 10:58:18 -0700, David
> <david.colliver.NEWS@revilloc.removethis.com> wrote:
>
> > [...]
> > Once the file has been saved, I need to then work on it. The process can
> > become quite intensive. Also, each file can come from a different
> > customer
> > and each customer will have a 'priority' preference, for example, some
> > files
> > have to be acted upon immediately (due to them being time critical) where
> > others that are not so critical can wait.
> >
> > My thoughts to handle this is a windows service with a filewatcher to
> > watch
> > the webservice receiving folder. Then, depending on the file (customer),
> > react to it...
> >
> > I guess I should be doing threading here (I have not really done any
> > threading before...) but I do have to bear in mind priority files. Also,
> > if
> > there are for example, 3 files from one phone, they have to be handled
> > chronologically.
> >
> > [...]
> > Ideas on how I should approach this would be very much appreciated.
>
> The question is very broad, and this is probably not the best forum for a
> deep discussion about your options.
>
> That said, some thoughts about what you've posted:
>
> -- Don't use FileSystemWatcher unless you really have to. It's a
> useful class in certain scenarios, but it isn't 100% reliable. If file
> system changes happen too rapidly for your own code to keep up,
> notifications may be discarded. It's extra work to make it reliable --
> basically you wind up having to do your own scans to double-check that you
> haven't missed anything -- and if you do that, then the apparent
> simplicity of using FileSystemWatcher winds up negated.
>
> Since you appear to have control over the code that's receiving the files,
> you will be much better off just managing your own queue of work based on
> what files you know you've received, rather than relying on the file
> system as your mediator between code modules.
>
> -- The prioritization feature has the potential for really causing
> problems. It's not really clear from your description what prioritization
> would be used, but hopefully it's something relatively simple. If it's
> okay for starvation to occur, then a simple ordered queue is probably a
> good bet. One thing you're vague about is whether priorities are for
> manging files for a specific user only, or whether users themselves have
> individual priorities that affect which user's files get processed first.
>
> A possible fallback to you implementing all the prioritization logic
> yourself would be to dedicate individual threads to each priority class
> you have, setting the thread priorities appropriately. I almost always
> recommend _against_ setting thread priorities, but in this case, as long
> as you can categorize your priorities in a reasonably few number of
> groups, it might actually work in your favor to set the thread priorities
> and then let Windows do the heavy lifting for you. Its thread scheduler
> has lots of little details in it to ensure that prioritization happens
> correctly without starving work and while maintaining a consistent flow.
>
> Other than that, I'd say that without a much more detailed description of
> your architecture,it would be difficult or impossible to offer any really
> useful design advice.
>
> Pete
>

David

10/29/2008 4:20:00 PM

0

Thanks Patrice,

I have never done a queue based system (and also done very little in the way
of generating events, which leads me onto a new thread that I will ask in a
short while.).

Would you be able to do a quick mock up so that I can understand the
principle (or point me in the direction)?

Thanks.

--
Best regards,
Dave Colliver.
http://www.Ashfiel...
~~
http://www.FOCUSP... - Local franchises available

"Patrice" <http://www.chez.com/s... wrote in message
news:BE6B921E-0F83-43FE-9562-8658659E93CA@microsoft.com...
> Same as Peter, I meant I would add them a processing queue (this is the
> word I omitted) or even queues (for example depending on priority) . In
> addition to the pure technical difference between a file system watcher
> and a queue, I feel it would allow to store some additional data that
> could help in managing each entry.
>
> It should be quite easy to do a mock up to simulate the base principle you
> would use...
>
> --
> Patrice
>
> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
> message de groupe de discussion : O1dGeBcOJHA.1744@TK2MSFTNGP06.phx.gbl...
>> Hi,
>>
>> Thanks Sloan, Peter and Patrice. Definately food for thought.
>>
>> Patrice, can you expand on what you mean?
>>
>>
>> The system has to work with a plugin architecture and be scalable. For
>> example, it will also be database driven and I need to be able to use
>> different databases. This I can easily achieve by using a layered
>> approach, something I haven't mentioned yet though is that it has to be
>> able to work from a clustered perspective as well (such as a clustered DB
>> server or clustered web server etc.) However, I don't think that affects
>> this part of the structure.
>>
>>
>> --
>> Best regards,
>> Dave Colliver.
>> http://www.Ashfiel...
>> ~~
>> http://www.FOCUSP... - Local franchises available
>>
>>
>> "Patrice" <http://www.chez.com/s... wrote in message
>> news:DD4305A1-614E-44FB-BA1B-59CC117C006D@microsoft.com...
>>> As files are submitted by using a web service I would add them to a
>>> processing at this point rather than just using the file system. This
>>> way you can add whatever you want to each entry (either priority,
>>> chronological time, current status, and even try to reprocess in case of
>>> a failure).
>>>
>>> Similary it should be easier to use multiple threads if needed this
>>> way...(i.e. basically you just share reading/setting the current
>>> status).
>>>
>>> --
>>> Patrice
>>>
>>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
>>> message de groupe de discussion :
>>> uJyGYbSOJHA.4372@TK2MSFTNGP04.phx.gbl...
>>>> Hi,
>>>>
>>>> This question could be very subjective but I am after a way to design
>>>> this...
>>>>
>>>> I am developing in C#, .NET 2.0
>>>>
>>>> Basically, I have data coming in from a mobile phone. This is sending a
>>>> file to a webservice. The webservice will save the file to local disk
>>>> and also send / receive messages from the mobile phone. This part is
>>>> working fine, though wether I should have a multi-thread on this, I
>>>> don't know.
>>>>
>>>>
>>>> Once the file has been saved, I need to then work on it. The process
>>>> can become quite intensive. Also, each file can come from a different
>>>> customer and each customer will have a 'priority' preference, for
>>>> example, some files have to be acted upon immediately (due to them
>>>> being time critical) where others that are not so critical can wait.
>>>>
>>>>
>>>> My thoughts to handle this is a windows service with a filewatcher to
>>>> watch the webservice receiving folder. Then, depending on the file
>>>> (customer), react to it...
>>>>
>>>> I guess I should be doing threading here (I have not really done any
>>>> threading before...) but I do have to bear in mind priority files.
>>>> Also, if there are for example, 3 files from one phone, they have to be
>>>> handled chronologically.
>>>>
>>>> We could be talking many thousands of files per day that need to be
>>>> handled (both for the webservice and windows service). Also, there
>>>> could be varying outputs, for example, some customers may just want a
>>>> raw processed file (XML), others may want an image while others may
>>>> want a PDF. Also, any / all of these could be selected.
>>>>
>>>> Finally, the file can be delivered either back to the phone, via email,
>>>> via FTP, HTTP to another web server or any other common communications
>>>> technology. (Again, any / all options could be selected.)
>>>>
>>>> I also have to make the application work on mulitple servers, though
>>>> that probably won't be such an issue unless I have a common fileserver
>>>> to store the incoming files and the filewatcher service on two servers
>>>> both attempt to collect the same file.
>>>>
>>>> Ideas on how I should approach this would be very much appreciated.
>>>>
>>>>
>>>> --
>>>> Best regards,
>>>> Dave Colliver.
>>>> http://www.Ashfiel...
>>>> ~~
>>>> http://www.FOCUSP... - Local franchises available
>>>>
>>>
>>
>>
>


Patrice

10/30/2008 5:52:00 PM

0

Hi,

I would suggest :

http://microsoft.apress.com/asptodayarchive/73445/a-managed-multithreaded-msmq-engine-running-as-a-windo......

In particular depending on your architecture using MSMQ could help...

--
Patrice

"David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
message de groupe de discussion : udrUjJeOJHA.588@TK2MSFTNGP06.phx.gbl...
> Thanks Patrice,
>
> I have never done a queue based system (and also done very little in the
> way of generating events, which leads me onto a new thread that I will ask
> in a short while.).
>
> Would you be able to do a quick mock up so that I can understand the
> principle (or point me in the direction)?
>
> Thanks.
>
> --
> Best regards,
> Dave Colliver.
> http://www.Ashfiel...
> ~~
> http://www.FOCUSP... - Local franchises available
>
> "Patrice" <http://www.chez.com/s... wrote in message
> news:BE6B921E-0F83-43FE-9562-8658659E93CA@microsoft.com...
>> Same as Peter, I meant I would add them a processing queue (this is the
>> word I omitted) or even queues (for example depending on priority) . In
>> addition to the pure technical difference between a file system watcher
>> and a queue, I feel it would allow to store some additional data that
>> could help in managing each entry.
>>
>> It should be quite easy to do a mock up to simulate the base principle
>> you would use...
>>
>> --
>> Patrice
>>
>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
>> message de groupe de discussion :
>> O1dGeBcOJHA.1744@TK2MSFTNGP06.phx.gbl...
>>> Hi,
>>>
>>> Thanks Sloan, Peter and Patrice. Definately food for thought.
>>>
>>> Patrice, can you expand on what you mean?
>>>
>>>
>>> The system has to work with a plugin architecture and be scalable. For
>>> example, it will also be database driven and I need to be able to use
>>> different databases. This I can easily achieve by using a layered
>>> approach, something I haven't mentioned yet though is that it has to be
>>> able to work from a clustered perspective as well (such as a clustered
>>> DB server or clustered web server etc.) However, I don't think that
>>> affects this part of the structure.
>>>
>>>
>>> --
>>> Best regards,
>>> Dave Colliver.
>>> http://www.Ashfiel...
>>> ~~
>>> http://www.FOCUSP... - Local franchises available
>>>
>>>
>>> "Patrice" <http://www.chez.com/s... wrote in message
>>> news:DD4305A1-614E-44FB-BA1B-59CC117C006D@microsoft.com...
>>>> As files are submitted by using a web service I would add them to a
>>>> processing at this point rather than just using the file system. This
>>>> way you can add whatever you want to each entry (either priority,
>>>> chronological time, current status, and even try to reprocess in case
>>>> of a failure).
>>>>
>>>> Similary it should be easier to use multiple threads if needed this
>>>> way...(i.e. basically you just share reading/setting the current
>>>> status).
>>>>
>>>> --
>>>> Patrice
>>>>
>>>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
>>>> message de groupe de discussion :
>>>> uJyGYbSOJHA.4372@TK2MSFTNGP04.phx.gbl...
>>>>> Hi,
>>>>>
>>>>> This question could be very subjective but I am after a way to design
>>>>> this...
>>>>>
>>>>> I am developing in C#, .NET 2.0
>>>>>
>>>>> Basically, I have data coming in from a mobile phone. This is sending
>>>>> a file to a webservice. The webservice will save the file to local
>>>>> disk and also send / receive messages from the mobile phone. This part
>>>>> is working fine, though wether I should have a multi-thread on this, I
>>>>> don't know.
>>>>>
>>>>>
>>>>> Once the file has been saved, I need to then work on it. The process
>>>>> can become quite intensive. Also, each file can come from a different
>>>>> customer and each customer will have a 'priority' preference, for
>>>>> example, some files have to be acted upon immediately (due to them
>>>>> being time critical) where others that are not so critical can wait.
>>>>>
>>>>>
>>>>> My thoughts to handle this is a windows service with a filewatcher to
>>>>> watch the webservice receiving folder. Then, depending on the file
>>>>> (customer), react to it...
>>>>>
>>>>> I guess I should be doing threading here (I have not really done any
>>>>> threading before...) but I do have to bear in mind priority files.
>>>>> Also, if there are for example, 3 files from one phone, they have to
>>>>> be handled chronologically.
>>>>>
>>>>> We could be talking many thousands of files per day that need to be
>>>>> handled (both for the webservice and windows service). Also, there
>>>>> could be varying outputs, for example, some customers may just want a
>>>>> raw processed file (XML), others may want an image while others may
>>>>> want a PDF. Also, any / all of these could be selected.
>>>>>
>>>>> Finally, the file can be delivered either back to the phone, via
>>>>> email, via FTP, HTTP to another web server or any other common
>>>>> communications technology. (Again, any / all options could be
>>>>> selected.)
>>>>>
>>>>> I also have to make the application work on mulitple servers, though
>>>>> that probably won't be such an issue unless I have a common fileserver
>>>>> to store the incoming files and the filewatcher service on two servers
>>>>> both attempt to collect the same file.
>>>>>
>>>>> Ideas on how I should approach this would be very much appreciated.
>>>>>
>>>>>
>>>>> --
>>>>> Best regards,
>>>>> Dave Colliver.
>>>>> http://www.Ashfiel...
>>>>> ~~
>>>>> http://www.FOCUSP... - Local franchises available
>>>>>
>>>>
>>>
>>>
>>
>
>

David

10/31/2008 10:33:00 AM

0

Cool. That's going into my favourites...

Cheers Patrice.

--
Best regards,
Dave Colliver.
http://www.Ashfiel...
~~
http://www.FOCUSP... - Local franchises available


"Patrice" <http://www.chez.com/s... wrote in message
news:8F1C5A5B-EF91-4B76-850A-986268E3CD0D@microsoft.com...
> Hi,
>
> I would suggest :
>
> http://microsoft.apress.com/asptodayarchive/73445/a-managed-multithreaded-msmq-engine-running-as-a-windo......
>
> In particular depending on your architecture using MSMQ could help...
>
> --
> Patrice
>
> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
> message de groupe de discussion : udrUjJeOJHA.588@TK2MSFTNGP06.phx.gbl...
>> Thanks Patrice,
>>
>> I have never done a queue based system (and also done very little in the
>> way of generating events, which leads me onto a new thread that I will
>> ask in a short while.).
>>
>> Would you be able to do a quick mock up so that I can understand the
>> principle (or point me in the direction)?
>>
>> Thanks.
>>
>> --
>> Best regards,
>> Dave Colliver.
>> http://www.Ashfiel...
>> ~~
>> http://www.FOCUSP... - Local franchises available
>>
>> "Patrice" <http://www.chez.com/s... wrote in message
>> news:BE6B921E-0F83-43FE-9562-8658659E93CA@microsoft.com...
>>> Same as Peter, I meant I would add them a processing queue (this is the
>>> word I omitted) or even queues (for example depending on priority) . In
>>> addition to the pure technical difference between a file system watcher
>>> and a queue, I feel it would allow to store some additional data that
>>> could help in managing each entry.
>>>
>>> It should be quite easy to do a mock up to simulate the base principle
>>> you would use...
>>>
>>> --
>>> Patrice
>>>
>>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
>>> message de groupe de discussion :
>>> O1dGeBcOJHA.1744@TK2MSFTNGP06.phx.gbl...
>>>> Hi,
>>>>
>>>> Thanks Sloan, Peter and Patrice. Definately food for thought.
>>>>
>>>> Patrice, can you expand on what you mean?
>>>>
>>>>
>>>> The system has to work with a plugin architecture and be scalable. For
>>>> example, it will also be database driven and I need to be able to use
>>>> different databases. This I can easily achieve by using a layered
>>>> approach, something I haven't mentioned yet though is that it has to be
>>>> able to work from a clustered perspective as well (such as a clustered
>>>> DB server or clustered web server etc.) However, I don't think that
>>>> affects this part of the structure.
>>>>
>>>>
>>>> --
>>>> Best regards,
>>>> Dave Colliver.
>>>> http://www.Ashfiel...
>>>> ~~
>>>> http://www.FOCUSP... - Local franchises available
>>>>
>>>>
>>>> "Patrice" <http://www.chez.com/s... wrote in message
>>>> news:DD4305A1-614E-44FB-BA1B-59CC117C006D@microsoft.com...
>>>>> As files are submitted by using a web service I would add them to a
>>>>> processing at this point rather than just using the file system. This
>>>>> way you can add whatever you want to each entry (either priority,
>>>>> chronological time, current status, and even try to reprocess in case
>>>>> of a failure).
>>>>>
>>>>> Similary it should be easier to use multiple threads if needed this
>>>>> way...(i.e. basically you just share reading/setting the current
>>>>> status).
>>>>>
>>>>> --
>>>>> Patrice
>>>>>
>>>>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
>>>>> message de groupe de discussion :
>>>>> uJyGYbSOJHA.4372@TK2MSFTNGP04.phx.gbl...
>>>>>> Hi,
>>>>>>
>>>>>> This question could be very subjective but I am after a way to design
>>>>>> this...
>>>>>>
>>>>>> I am developing in C#, .NET 2.0
>>>>>>
>>>>>> Basically, I have data coming in from a mobile phone. This is sending
>>>>>> a file to a webservice. The webservice will save the file to local
>>>>>> disk and also send / receive messages from the mobile phone. This
>>>>>> part is working fine, though wether I should have a multi-thread on
>>>>>> this, I don't know.
>>>>>>
>>>>>>
>>>>>> Once the file has been saved, I need to then work on it. The process
>>>>>> can become quite intensive. Also, each file can come from a different
>>>>>> customer and each customer will have a 'priority' preference, for
>>>>>> example, some files have to be acted upon immediately (due to them
>>>>>> being time critical) where others that are not so critical can wait.
>>>>>>
>>>>>>
>>>>>> My thoughts to handle this is a windows service with a filewatcher to
>>>>>> watch the webservice receiving folder. Then, depending on the file
>>>>>> (customer), react to it...
>>>>>>
>>>>>> I guess I should be doing threading here (I have not really done any
>>>>>> threading before...) but I do have to bear in mind priority files.
>>>>>> Also, if there are for example, 3 files from one phone, they have to
>>>>>> be handled chronologically.
>>>>>>
>>>>>> We could be talking many thousands of files per day that need to be
>>>>>> handled (both for the webservice and windows service). Also, there
>>>>>> could be varying outputs, for example, some customers may just want a
>>>>>> raw processed file (XML), others may want an image while others may
>>>>>> want a PDF. Also, any / all of these could be selected.
>>>>>>
>>>>>> Finally, the file can be delivered either back to the phone, via
>>>>>> email, via FTP, HTTP to another web server or any other common
>>>>>> communications technology. (Again, any / all options could be
>>>>>> selected.)
>>>>>>
>>>>>> I also have to make the application work on mulitple servers, though
>>>>>> that probably won't be such an issue unless I have a common
>>>>>> fileserver to store the incoming files and the filewatcher service on
>>>>>> two servers both attempt to collect the same file.
>>>>>>
>>>>>> Ideas on how I should approach this would be very much appreciated.
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Best regards,
>>>>>> Dave Colliver.
>>>>>> http://www.Ashfiel...
>>>>>> ~~
>>>>>> http://www.FOCUSP... - Local franchises available
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>


David

11/1/2008 4:33:00 PM

0

Hi Patrice,

Gone through the whole article and written the sample app. Towards the end
of article is a sentence that says to download the WROXTester project, but
no link to it. I have done a google for wroxtester but cannot find it.

Any ideas on the other side of this story? It looks like the app I have
written from this site is the receiving side of the queue. I also need to
see the sending side.

This queueing system could be the answer to a lot of the design questions...
it sounds like we can use this to help us scale the app, say for example, we
find one of our services is getting bogged down (being process intensive),
we can quite quickly add in another server to handle some of the processing.
This is quite cool.
--
Best regards,
Dave Colliver.
http://www.Ashfiel...
~~
http://www.FOCUSP... - Local franchises available


"David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
news:OKH1IR0OJHA.3508@TK2MSFTNGP02.phx.gbl...
> Cool. That's going into my favourites...
>
> Cheers Patrice.
>
> --
> Best regards,
> Dave Colliver.
> http://www.Ashfiel...
> ~~
> http://www.FOCUSP... - Local franchises available
>
>
> "Patrice" <http://www.chez.com/s... wrote in message
> news:8F1C5A5B-EF91-4B76-850A-986268E3CD0D@microsoft.com...
>> Hi,
>>
>> I would suggest :
>>
>> http://microsoft.apress.com/asptodayarchive/73445/a-managed-multithreaded-msmq-engine-running-as-a-windo......
>>
>> In particular depending on your architecture using MSMQ could help...
>>
>> --
>> Patrice
>>
>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
>> message de groupe de discussion : udrUjJeOJHA.588@TK2MSFTNGP06.phx.gbl...
>>> Thanks Patrice,
>>>
>>> I have never done a queue based system (and also done very little in the
>>> way of generating events, which leads me onto a new thread that I will
>>> ask in a short while.).
>>>
>>> Would you be able to do a quick mock up so that I can understand the
>>> principle (or point me in the direction)?
>>>
>>> Thanks.
>>>
>>> --
>>> Best regards,
>>> Dave Colliver.
>>> http://www.Ashfiel...
>>> ~~
>>> http://www.FOCUSP... - Local franchises available
>>>
>>> "Patrice" <http://www.chez.com/s... wrote in message
>>> news:BE6B921E-0F83-43FE-9562-8658659E93CA@microsoft.com...
>>>> Same as Peter, I meant I would add them a processing queue (this is the
>>>> word I omitted) or even queues (for example depending on priority) . In
>>>> addition to the pure technical difference between a file system watcher
>>>> and a queue, I feel it would allow to store some additional data that
>>>> could help in managing each entry.
>>>>
>>>> It should be quite easy to do a mock up to simulate the base principle
>>>> you would use...
>>>>
>>>> --
>>>> Patrice
>>>>
>>>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
>>>> message de groupe de discussion :
>>>> O1dGeBcOJHA.1744@TK2MSFTNGP06.phx.gbl...
>>>>> Hi,
>>>>>
>>>>> Thanks Sloan, Peter and Patrice. Definately food for thought.
>>>>>
>>>>> Patrice, can you expand on what you mean?
>>>>>
>>>>>
>>>>> The system has to work with a plugin architecture and be scalable. For
>>>>> example, it will also be database driven and I need to be able to use
>>>>> different databases. This I can easily achieve by using a layered
>>>>> approach, something I haven't mentioned yet though is that it has to
>>>>> be able to work from a clustered perspective as well (such as a
>>>>> clustered DB server or clustered web server etc.) However, I don't
>>>>> think that affects this part of the structure.
>>>>>
>>>>>
>>>>> --
>>>>> Best regards,
>>>>> Dave Colliver.
>>>>> http://www.Ashfiel...
>>>>> ~~
>>>>> http://www.FOCUSP... - Local franchises available
>>>>>
>>>>>
>>>>> "Patrice" <http://www.chez.com/s... wrote in message
>>>>> news:DD4305A1-614E-44FB-BA1B-59CC117C006D@microsoft.com...
>>>>>> As files are submitted by using a web service I would add them to a
>>>>>> processing at this point rather than just using the file system. This
>>>>>> way you can add whatever you want to each entry (either priority,
>>>>>> chronological time, current status, and even try to reprocess in case
>>>>>> of a failure).
>>>>>>
>>>>>> Similary it should be easier to use multiple threads if needed this
>>>>>> way...(i.e. basically you just share reading/setting the current
>>>>>> status).
>>>>>>
>>>>>> --
>>>>>> Patrice
>>>>>>
>>>>>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> a écrit dans le
>>>>>> message de groupe de discussion :
>>>>>> uJyGYbSOJHA.4372@TK2MSFTNGP04.phx.gbl...
>>>>>>> Hi,
>>>>>>>
>>>>>>> This question could be very subjective but I am after a way to
>>>>>>> design this...
>>>>>>>
>>>>>>> I am developing in C#, .NET 2.0
>>>>>>>
>>>>>>> Basically, I have data coming in from a mobile phone. This is
>>>>>>> sending a file to a webservice. The webservice will save the file to
>>>>>>> local disk and also send / receive messages from the mobile phone.
>>>>>>> This part is working fine, though wether I should have a
>>>>>>> multi-thread on this, I don't know.
>>>>>>>
>>>>>>>
>>>>>>> Once the file has been saved, I need to then work on it. The process
>>>>>>> can become quite intensive. Also, each file can come from a
>>>>>>> different customer and each customer will have a 'priority'
>>>>>>> preference, for example, some files have to be acted upon
>>>>>>> immediately (due to them being time critical) where others that are
>>>>>>> not so critical can wait.
>>>>>>>
>>>>>>>
>>>>>>> My thoughts to handle this is a windows service with a filewatcher
>>>>>>> to watch the webservice receiving folder. Then, depending on the
>>>>>>> file (customer), react to it...
>>>>>>>
>>>>>>> I guess I should be doing threading here (I have not really done any
>>>>>>> threading before...) but I do have to bear in mind priority files.
>>>>>>> Also, if there are for example, 3 files from one phone, they have to
>>>>>>> be handled chronologically.
>>>>>>>
>>>>>>> We could be talking many thousands of files per day that need to be
>>>>>>> handled (both for the webservice and windows service). Also, there
>>>>>>> could be varying outputs, for example, some customers may just want
>>>>>>> a raw processed file (XML), others may want an image while others
>>>>>>> may want a PDF. Also, any / all of these could be selected.
>>>>>>>
>>>>>>> Finally, the file can be delivered either back to the phone, via
>>>>>>> email, via FTP, HTTP to another web server or any other common
>>>>>>> communications technology. (Again, any / all options could be
>>>>>>> selected.)
>>>>>>>
>>>>>>> I also have to make the application work on mulitple servers, though
>>>>>>> that probably won't be such an issue unless I have a common
>>>>>>> fileserver to store the incoming files and the filewatcher service
>>>>>>> on two servers both attempt to collect the same file.
>>>>>>>
>>>>>>> Ideas on how I should approach this would be very much appreciated.
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Best regards,
>>>>>>> Dave Colliver.
>>>>>>> http://www.Ashfiel...
>>>>>>> ~~
>>>>>>> http://www.FOCUSP... - Local franchises available
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>