Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Doubt in JMS  RSS feed

Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

* MQ --> JMS(MDB) --> Oracle DB *

The above is the scenario, the data will be read by MQ and MDB will do some processing, then updates the data in to the oracle.

But the restriction here is the DB might go down for 6-7 hours daily, at that time the MDB should not run ( read the message & process it).

Please help me suggesting some design for the above scenario like

1. How to deploy & Undeploy the MDB on timely basis
2. Can I have some scheduler in JMS service

Thanks in Advance
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can do that,As you know that we have TimerService in EJB 2.1 ownward,which can run automatically on given time period.
So you can use TimeService as background process which keep testing your data base status,if the data base is down that you can undeploy the MDB.
You need to pack your MDB as a seperate JAR file,so that when you deploy/un-deploy other component will not get effected.
And you need to explorer how you can deploy/undeploy JAR files on different conatiners.
But I can give to some start point so that you can start as far as deployment/un-deployment is concern.
If you go to your application server amin page,where you can deploy/un-deploy your EJB,just place the mouse over the link than It will show what url is being invoked.
e.g. in Tomcat if you want to stop any context than http://<host>:<port>/manager/html/stop?path=<context name> is used
and we can achive using simple java code which make connection to given url and stop the context.
So when the timer service came to know that database is down than it will undeploy your MDB and when DB is back than it will deploy the MDB.

Hope that this will help you.

Sunil Dixit
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!