Hi,
I need to schedule my JMS topic to run MDBs in certain times of the day. Since the application needs to run in multiple J2EE application servers and the standard JMS [b]javax.jms.MessageProducer[/b] does not have a time based delivery method such as WebLogic's [b]weblogic.jms.extensions.WLMessageProducer.setTimeToDeliver(long)[/b], it makes the application rely on cron tabs and other system-dependent scheduling tools.
An alternative may be if the MDBs implement J2EE 1.4's [b] javax.ejb.TimedObject[/b], but that's impossible because the app is running J2EE 1.3 and an upgrade is not coming any time soon.
So, I am stuck with this problem. If any of you had to deal with a similar scenario, please let me know.
Thank you in advance.
-
JMS Scheduling - J2EE 1.3 (6 messages)
- Posted by: Levent Gurses
- Posted on: November 22 2005 19:36 EST
Threaded Messages (6)
- JMS Scheduling - J2EE 1.3 by James Strachan on November 23 2005 03:45 EST
- JMS Scheduling - J2EE 1.3 by D S on November 23 2005 07:59 EST
- JMS Scheduling - J2EE 1.3 by James Strachan on November 23 2005 09:04 EST
-
JMS Scheduling - J2EE 1.3 by D S on November 23 2005 12:59 EST
- JMS Scheduling - J2EE 1.3 by Levent Gurses on November 23 2005 01:41 EST
-
JMS Scheduling - J2EE 1.3 by D S on November 23 2005 12:59 EST
- JMS Scheduling - J2EE 1.3 by James Strachan on November 23 2005 09:04 EST
- JMS Scheduling by kerem argenc on November 23 2005 08:31 EST
-
JMS Scheduling - J2EE 1.3[ Go to top ]
- Posted by: James Strachan
- Posted on: November 23 2005 03:45 EST
- in response to Levent Gurses
Hi, I need to schedule my JMS topic to run MDBs in certain times of the day. Since the application needs to run in multiple J2EE application servers and the standard JMS [b]javax.jms.MessageProducer[/b] does not have a time based delivery method such as WebLogic's [b]weblogic.jms.extensions.WLMessageProducer.setTimeToDeliver(long)[/b], it makes the application rely on cron tabs and other system-dependent scheduling tools. An alternative may be if the MDBs implement J2EE 1.4's [b] javax.ejb.TimedObject[/b], but that's impossible because the app is running J2EE 1.3 and an upgrade is not coming any time soon. So, I am stuck with this problem. If any of you had to deal with a similar scenario, please let me know. Thank you in advance.
Why do you need to run the MDBs at certain times of the day? MDBS consume messages when they are available - if there are no messages available there is no real harm in running the MDB - so why not just leave the MDBs running all the time?
James
LogicBlaze -
JMS Scheduling - J2EE 1.3[ Go to top ]
- Posted by: D S
- Posted on: November 23 2005 07:59 EST
- in response to Levent Gurses
In the real world there are occasions where you need to do things "out of hours" or according to a schedule which is not under your control (passing information across to external or legacy systems or whatever). In these circumstances, you don't have any choice, you have to make it work somehow and do the best you can.
We had a similar requirement with one of our applications a couple of years ago. The MDBs were controlled by a timed job which deployed them at a certain time of day so that they just picked up and started processing through whatever messages had accumulated on the queue during the day. Then at a set time next morning another job undeployed them again when the processing window closed. We used proprietary WebLogic calls to deploy and undeploy the MDBs but I guess you'd probably use JMX instead as being a more portable solution. -
JMS Scheduling - J2EE 1.3[ Go to top ]
- Posted by: James Strachan
- Posted on: November 23 2005 09:04 EST
- in response to D S
In the real world there are occasions where you need to do things "out of hours" or according to a schedule which is not under your control (passing information across to external or legacy systems or whatever). In these circumstances, you don't have any choice, you have to make it work somehow and do the best you can.
I totally understand why you might need a scheduler to kick off certain operations at certain times. FWIW I'd recommend the use of Quartz for these circumstances.
http://opensymphony.com/quartz/
However I was arguing against the requirement to deploy MDBs at specific times; if there are no messages to consume an MDB being deployed doesn't really harm anything.We had a similar requirement with one of our applications a couple of years ago. The MDBs were controlled by a timed job which deployed them at a certain time of day so that they just picked up and started processing through whatever messages had accumulated on the queue during the day. Then at a set time next morning another job undeployed them again when the processing window closed. We used proprietary WebLogic calls to deploy and undeploy the MDBs but I guess you'd probably use JMX instead as being a more portable solution.
Why not just process the messages while they arrive? Or is it that the MDB cannot process messages at certain times of the day due to dependent systems being down?
James
LogicBlaze -
JMS Scheduling - J2EE 1.3[ Go to top ]
- Posted by: D S
- Posted on: November 23 2005 12:59 EST
- in response to James Strachan
However I was arguing against the requirement to deploy MDBs at specific times; if there are no messages to consume an MDB being deployed doesn't really harm anything. ... Why not just process the messages while they arrive? Or is it that the MDB cannot process messages at certain times of the day due to dependent systems being down?
You're right, Quartz is an absolutely top quality piece of software.
As far as receiving messages goes, again you're right: if there are no messages to consume, it doesn't make any difference whether your MDB is deployed or not. But the problem comes if you receive a message that you can't process yet for some reason. Then what do you do? In our case, we were passing the information across to a mainframe system via a legacy interface which was only available at certain periods of the day (don't ask why - it was a procedure that probably made sense in 1975). We did consider receiving the message and writing it out to a database table for later processing, but what would be the point of that? All that is doing is writing our own crude queueing mechanism so why not just leave the messages in the JMS queue until we want to consume them? -
JMS Scheduling - J2EE 1.3[ Go to top ]
- Posted by: Levent Gurses
- Posted on: November 23 2005 13:41 EST
- in response to D S
...But the problem comes if you receive a message that you can't process yet for some reason...
DS, that's exactly the situation here. There is a constraint that the MDBs should run between 1:00AM-2:00AM every morning, when the server load is at minimum. For situations like this I'd like to be able to run my beans only in that particular time window. Ans that's where the problem lies.
Thanks all for your thoughts.
--------------------------------
Levent Gurses
Jacoozi - New Generation E-Solutions for >> Thinking Companies
http://www.jacoozi.com -
JMS Scheduling[ Go to top ]
- Posted by: kerem argenc
- Posted on: November 23 2005 08:31 EST
- in response to Levent Gurses
i have a little java program on the background for creating jms scheduled. :)
my be bad solution but was needed..
regards,