3

I need to submit data from a web application to console application. The current plan calls for the web app to submit data to the database and the console app to poll the database then act on the data when it is inserted. Should I change the console app to include an http handler that the web app can submit data so it doesn't have to poll the database? Is there a better way to communicate data between these two applications? The console app never has to send data to the web app.

Update

This is a .NET 2.0 console application so WCF doesn't seem like a viable option. The data payload is fairly small (a few 9 digit ID fields, less than 150 bytes total), and will be sent with a rate of about 10 per minute. There is no firewall between these two applications.

2
  • is remoting or msmq out of the question? Commented Feb 6, 2009 at 23:23
  • They are not out of the question, but I have never used them before. I am looking into them now to see what would work best. Commented Feb 6, 2009 at 23:31

3 Answers 3

2

I'm not sure of your requirements, or setup but WCF could be an option.

[edit]
To expand, you could host a wcf service in the console app, and have the asp.net site call it. For that matter, remoting (or any other form) could work as well. This way you wouldn't have to have the console app pool the database when not necessary.

Sign up to request clarification or add additional context in comments.

1 Comment

This is a great answer. I've just made this solution the other day. Works like a charm. First I used Named-pipes, but those are too few for high performance sites. So now I have a WCF service hosted (servicehost) in my console application (which will be a real service running the background once we get it completed and tested 100%)
0

Using the simplest technologies, your Console App could connect to the database in a loop controlled by a Timer or a BackgroundWorker. You would need a way to know what records are new and which aren't. If you can delete the records from that table when you poll them, it means each time you do it, you'll get only new records. If you can't delete them, use a TimeStamp field in that table and each time you poll you select the records with that time stamp greater than the maximum time stamp of the previous batch. If you need to mark those records as processed, then you can set that flag and forget about the timestamp.

Comments

0

You basically want an app to app communication. There are a lot of options, but really depend on your requirement (how much data, how big, how often, latency), environment (behind firewall, online/offline, recovery) and so on.

Using a Database is one solution. But you could use others - like webservice (wcf), messaging system(msmq), .net remoting even.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.