• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Persistent Messages, What heppens if a system is started!

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am new to JMS and trying to understand. I have a Web Service that put messges on a queue. Now on the consumer side I have a Message Driven Bean. What if my MDB is not available and the WS puts some messages in a queue. The messages are still in a queue but not consumed as MDB is not available. Now I restarted the whole system and server and redeployed the MDB but I don't see any messages being consumed by MDB even though there are some messages that are put by Web Service before starting the System. Are the messages lost if in a queue but not yet consumed and a system or server is restarted.

How can I make the messages available in a queue all the time even after a restart. Here is a snippet of code that ques the messages.



If messages gets lost if the system or server is restarted then what's the point of Persistent Messages. Any help is appreciated.

Thanks
 
Mike Boota
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using Oracle App. Server

Thanks
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Something strange with your scenario- if the messages are persistent then they must survive an application server restart. What application server are you using? And which JMS Provider- the one coming with the App Server or something else like MQSeries or Oracle Streams?
 
Mike Boota
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using Oracle App. Server and using the povider that comes with the App. Server.

Thanks
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But what is your back-end data store, is it a database.

As an example, JBoss stores messages in a database. By default it uses the DefaultDS DataSource, which out of the box is Hypersonic, which is an in-memory database, so if the server crashes or is restarted you lose the messages that are in the database. If you change the DefaultDS to point to a database like Oracle, then the messages are persisted even if the server crashes. and on restart reget those saved messages and deliver them.

Mark
 
Mike Boota
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't set the default datasource and am not sure where exactly that needs to be set. I assumed if not using DB the messages will be store to a file.

Following is what I have in my MDB ejb-jar.xml


and here is my orion-ejb.jar


I don't see any default datasource settings any idea where I hav to define that. Thanks
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic