This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Persistent Messages, What heppens if a system is started!

 
Mike Boota
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Using Oracle App. Server

Thanks
 
Jorge Ribeiro
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Using Oracle App. Server and using the povider that comes with the App. Server.

Thanks
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic