You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Nilantha Jayalath <Ni...@autodata.net> on 2007/01/30 19:35:14 UTC

JDBC persistance in AMQ 4.1.0

I am testing JDBC persistence with one broker and my
"persistenceAdapter' configuration is as follows, 
    <persistenceAdapter> 
      
      <journaledJDBC journalLogFiles="5"  dataSource="#oracle-ds"/> 
        
    </persistenceAdapter> 

I have noticed following at one point When I sent some 50000 messages
without consuming. 

No of messages in DB( in "ACTIVEMQ_MSGS"): 43764 
Total in queue: 51128 (through Jconsole) 

After some time all the messages were available in DB. It appears that
broker keeps messages in memory until it close to allowable memory limit
and then flush into the DB(more than 10k some times depend on the
message size ). Is there a way I could force DB persistence without
keeping messages in memory. 

My concern is in case of a hardware failure those in memory messages
could be lost? 

Thanks in advance for any idea on this. Broker on Win XP Professional

 

-Nilantha


RE: JDBC persistance in AMQ 4.1.0

Posted by Nilantha Jayalath <Ni...@autodata.net>.
Thank you James,

-Nilantha

-----Original Message-----
From: James Strachan [mailto:james.strachan@gmail.com] 
Sent: Thursday, February 01, 2007 8:38 AM
To: activemq-users@geronimo.apache.org
Subject: Re: JDBC persistance in AMQ 4.1.0

On 1/30/07, Nilantha Jayalath <Ni...@autodata.net> wrote:
> Hi Rob,
> Thank you for the response and your time.
> Actually my main worry is what happens if my journal files are lost
due
> to a hardware failure before moving messages into the long term store.

Then you are hosed. If you cannot rely on local storage, don't use the
journal and just use pure JDBC (which is much much slower) - see the
example here

http://activemq.apache.org/persistence.html


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: JDBC persistance in AMQ 4.1.0

Posted by James Strachan <ja...@gmail.com>.
On 1/30/07, Nilantha Jayalath <Ni...@autodata.net> wrote:
> Hi Rob,
> Thank you for the response and your time.
> Actually my main worry is what happens if my journal files are lost due
> to a hardware failure before moving messages into the long term store.

Then you are hosed. If you cannot rely on local storage, don't use the
journal and just use pure JDBC (which is much much slower) - see the
example here

http://activemq.apache.org/persistence.html


-- 

James
-------
http://radio.weblogs.com/0112098/

RE: JDBC persistance in AMQ 4.1.0

Posted by Nilantha Jayalath <Ni...@autodata.net>.
Hi Rob,
Thank you for the response and your time.
Actually my main worry is what happens if my journal files are lost due
to a hardware failure before moving messages into the long term store.

What is the recommended way for message persistence in such a scenario?

Thank you
Nilantha

-----Original Message-----
From: Rob Davies [mailto:rajdavies@gmail.com] 
Sent: Tuesday, January 30, 2007 4:18 PM
To: activemq-users@geronimo.apache.org
Subject: Re: JDBC persistance in AMQ 4.1.0 

Hi Nilantha,

in this configuration, messages are always written to a journal, so  
the broker can be recovered in case of an outage. Messages are kept  
in memory also for performance. Messages are moved to the long term  
store (in this case JDBC) periodically. As long as the journal file 
(s) are intact, recovery shouldn't not be  an issue

cheers,

Rob
On 30 Jan 2007, at 18:35, Nilantha Jayalath wrote:

> I am testing JDBC persistence with one broker and my
> "persistenceAdapter' configuration is as follows,
>     <persistenceAdapter>
>
>       <journaledJDBC journalLogFiles="5"  dataSource="#oracle-ds"/>
>
>     </persistenceAdapter>
>
> I have noticed following at one point When I sent some 50000 messages
> without consuming.
>
> No of messages in DB( in "ACTIVEMQ_MSGS"): 43764
> Total in queue: 51128 (through Jconsole)
>
> After some time all the messages were available in DB. It appears that
> broker keeps messages in memory until it close to allowable memory  
> limit
> and then flush into the DB(more than 10k some times depend on the
> message size ). Is there a way I could force DB persistence without
> keeping messages in memory.
>
> My concern is in case of a hardware failure those in memory messages
> could be lost?
>
> Thanks in advance for any idea on this. Broker on Win XP Professional
>
>
>
> -Nilantha
>


Re: JDBC persistance in AMQ 4.1.0

Posted by Rob Davies <ra...@gmail.com>.
Hi Nilantha,

in this configuration, messages are always written to a journal, so  
the broker can be recovered in case of an outage. Messages are kept  
in memory also for performance. Messages are moved to the long term  
store (in this case JDBC) periodically. As long as the journal file 
(s) are intact, recovery shouldn't not be  an issue

cheers,

Rob
On 30 Jan 2007, at 18:35, Nilantha Jayalath wrote:

> I am testing JDBC persistence with one broker and my
> "persistenceAdapter' configuration is as follows,
>     <persistenceAdapter>
>
>       <journaledJDBC journalLogFiles="5"  dataSource="#oracle-ds"/>
>
>     </persistenceAdapter>
>
> I have noticed following at one point When I sent some 50000 messages
> without consuming.
>
> No of messages in DB( in "ACTIVEMQ_MSGS"): 43764
> Total in queue: 51128 (through Jconsole)
>
> After some time all the messages were available in DB. It appears that
> broker keeps messages in memory until it close to allowable memory  
> limit
> and then flush into the DB(more than 10k some times depend on the
> message size ). Is there a way I could force DB persistence without
> keeping messages in memory.
>
> My concern is in case of a hardware failure those in memory messages
> could be lost?
>
> Thanks in advance for any idea on this. Broker on Win XP Professional
>
>
>
> -Nilantha
>