Reputation: 3558
I am encountering a situation at work similar to the thread over here. The difference is that we are not using a web service. But rather we are using a web app. We have a requirement that lets a user download 8000 records with at least 30 columns which is written to an excel file via jxl.
This is a long running process that is not being done asynchronously for reasons I don't know. It also has a huge memory footprint ~ 500 - 800 MB. To top it all of, it takes on average 2 minutes and 10 seconds to finish.
What we are currently doing is delegating this requirement out of process from the application server via jms. The app server sends the request to the broker and then a consumer gets the request from the queue, processes it and sends back the url of the excel file.
I have some qualms about this because I have read been reading about JMS and most of the usecases suggested involve asynchronous requests so that users won't have to wait for a long time like for instance sending email, sending a request for approval, invoicing. There are lot of examples in this thread and the use cases suggested can be done asynchronously. So our current solution sounds like a hack rather than a true solution.
Any suggestions, patterns that can be done to further improve this process?
EDIT: I unfortunately can't do away with the "synchronicity" if you may call it that of the feature because it's a business requirement. So I am looking for answers/tweaks/tricks/patterns that can enhance the performance and lessen the heap memory usage of the process instead.
Upvotes: 1
Views: 1897
Reputation: 1219
I'm not gonna suggest what you can do with your JMS backend - its probably not used well or maybe it is - I'm not sure.
We implemented something similar and here is what we ended up with (our backend implmentation was completely different, for a different use case, but the "async user exp" matches) :
Upvotes: 1
Reputation: 299218
Did I understand this right?
If so, I agree, that's an awful abuse of the asynchroneous nature of JMS.
What I would do is:
Immediately show the user a result page with a text like your request is being processed and then
Upvotes: 4