views:

185

answers:

2

Greetings,

In the application that I am working on, I have a long-running process (DNA analysis). Users can send requests, and I am thinking of queuing the requests in a JMS queue, then processing the requests in the queue accordingly. Then, the result is emailed to the particular user.

However, an admin should be able to change the order/priority of the requests. I am wondering whether it is possible to change the order of JMS queue. What technology can I use? Can I go with ActiveMQ for this?

PS: This 'DNA-Analysis' process is a resource hungry process accessed via JNI. Only one (or limted) processes should run at once.

+1  A: 

If your processes are long running (and you don't have any other requirements that fit the messaging domain) you could simply poll a database table for new jobs (ordered by priority). The Spring JDBC abstraction should be enough to get you started. If you are using an Oracle DBMS you could replace polling by subscribing, using triggers and AQ - this can also be done in plain SQL.

Given no other requirements you would not need ORM or JMS.

yawn
+1  A: 

Here are a few ideas that come in mind:

  • AFAIK, the body of a JMS message is immutable so if you want to modify the content of the body, you'll have to consume and resend a modified version of JMS message into the Queue.

  • Another option would be to implement some kind of filtering at the JMS client level to give the admin a way to control the next message(s) to consume.

  • You could consume JMS messages to create Quartz jobs and administrate the Quartz job queue (in this case, do you still need JMS?).

Pascal Thivent