Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMS architectural problem?

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.

like image 631
Ashika Umanga Umagiliya Avatar asked Dec 04 '25 17:12

Ashika Umanga Umagiliya


2 Answers

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?).

like image 86
Pascal Thivent Avatar answered Dec 07 '25 07:12

Pascal Thivent


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.

like image 22
yawn Avatar answered Dec 07 '25 06:12

yawn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!