I am working on a web-based project consisting of 2 parts: The first part is uploading a csv file containing about 500 records, 2 or 3 times a day. There is a servlet which accepts the file, parses it, validates it and inserts the records into a table. There is another standalone java program that runs behind this web application, which keeps polling for new records in the table and picks them up, connects to a third-party system calls a few published methods and updates the new records in the table as processed. It then goes back to its polling state looking for new records every 2 minutes..... Like this it keeps polling all day.....24 hrs a day..7 days a week....365 days a year..... I thought MDBs can be used, instead of dedicated polling but the third-party system accepts only 5 connections at a time. In other words I can have only 5 MDBs processing the requests at any point of time. Is the existing design fine or is it worth changing it to use MDBs? The application is supposed to be run on JBoss.
Originally posted by Louis Malenica: Hi Vish, why are you unhappy with the current application? Is it a performance issue?
Louis, This is a small application, which may not have much performance issues. We are coding with the existing design, as the architect had already approved this. But I am not able to get in touch with the architect at the moment to clarify my questions. From a design point of view, I thought there could be a better way than doing a "dedicated polling" for new unprocessed records in a table. I am just curious. :roll: to know if there is a better way... Perhaps using JMS?
Well if you want to use JMS you will need a JMS server, meaning you will probably run it from a J2EE container and use MDB's. This is quite an expensive way of running one small listening tool. If it works the way it is now, why do you need to change it?
Regarding the comment about, JMS: JMS for sure is perceived as integral to J2EE. But, as long as the class loaders are properly setup, we can use JMS seamelessly without the help of a J2EE server. Some times there are issues that are observed with object messages if a full fledged J2EE server is not used. But this is for sure doable. So, you can for sure try JMS without necessaryly buying a J2EE server or going after the complexity that comes into picture with J2EE when the task at hand is not too complex and distributed. Dan.