You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Ramesh Bobba <ra...@transerainc.com> on 2007/04/01 08:08:55 UTC

JDBC Persistance

I have three producers producing 80K messages every 2 seconds, I have
three consumers subscribed as durable consumers. I am using mysql as
persistence. What I see is that the messages are being written to the
database even when all the subscribers are up. I thought that broker
only writes to the datasource if it has to. Can anyone explain what I am
missing? Here is my configuration: I am using activemq 4.0.1

 

<beans xmlns="http://activemq.org/config/1.0">

 

  <broker useJmx="true" brokerName="cdx-server"
deleteAllMessagesOnStartup="true" persistent="true">

    <persistenceAdapter>

      <journaledJDBC dataSource="#mysql-ds"/>

    </persistenceAdapter>

 

    <transportConnectors>

       <transportConnector name="default" uri="tcp://localhost:9082"/>

    </transportConnectors>

  </broker>

  <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">

    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>

    <property name="url"
value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>

    <property name="username" value="transera"/>

    <property name="password" value="transera"/>

    <property name="poolPreparedStatements" value="true"/>

  </bean>

</beans>

 

Ramesh.


RE: JDBC Persistance

Posted by Ramesh Bobba <ra...@transerainc.com>.
Hi James,

Is 4.2 production ready? Also, I switched the JDBC from mysql to
embedded derby db. I still see the disk growth. Is it possible to get
the cleanup of records in the db to happen faster? I guess I am asking
if there is any configuration parameters that I can set? The CPU usage
is minimal. Its just that we produce large sized messages.

I can't use queues because the number of clients varies and they all
want the same data.


Thanks,

Ramesh.

-----Original Message-----
From: James Strachan [mailto:james.strachan@gmail.com] 
Sent: Monday, April 02, 2007 8:44 AM
To: users@activemq.apache.org
Subject: Re: JDBC Persistance

There is a lag if using the journal based on the journal checkpoint
time; so using pure JDBC and no journal will use less disk (though be
much slower). Also there is a further lag if you are using durable
topics (since the deletion of messages is a background task). You
might want to use queues if you want more immediate deletion & freeing
of resources.

Finally using AMQStore in 4.2 should use less disk space than a JDBC
database.


On 4/2/07, Ramesh Bobba <ra...@transerainc.com> wrote:
> Hi James,
>
> I do want to use persistent delivery. The problem I am seeing is the
> messages from the persistent store are not being deleted fast enough.
My
> disk is getting full. Is there any way to control this? Do you think
> setAsyncSend(true) will help?
>
>
> Thanks,
>
>
> Ramesh.
>
> -----Original Message-----
> From: James Strachan [mailto:james.strachan@gmail.com]
> Sent: Monday, April 02, 2007 1:27 AM
> To: users@activemq.apache.org
> Subject: Re: JDBC Persistance
>
> On 4/1/07, Ramesh Bobba <ra...@transerainc.com> wrote:
> > I have three producers producing 80K messages every 2 seconds, I
have
> > three consumers subscribed as durable consumers. I am using mysql as
> > persistence. What I see is that the messages are being written to
the
> > database even when all the subscribers are up.
> >
> > I thought that broker
> > only writes to the datasource if it has to.
>
> It does
>
> If you don't want persistence to take place, don't use persistent
> delivery.
>
http://cwiki.apache.org/ACTIVEMQ/what-is-the-difference-between-persiste
> nt-and-non-persistent-delivery.html
>
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


-- 

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

Re: JDBC Persistance

Posted by James Strachan <ja...@gmail.com>.
There is a lag if using the journal based on the journal checkpoint
time; so using pure JDBC and no journal will use less disk (though be
much slower). Also there is a further lag if you are using durable
topics (since the deletion of messages is a background task). You
might want to use queues if you want more immediate deletion & freeing
of resources.

Finally using AMQStore in 4.2 should use less disk space than a JDBC database.


On 4/2/07, Ramesh Bobba <ra...@transerainc.com> wrote:
> Hi James,
>
> I do want to use persistent delivery. The problem I am seeing is the
> messages from the persistent store are not being deleted fast enough. My
> disk is getting full. Is there any way to control this? Do you think
> setAsyncSend(true) will help?
>
>
> Thanks,
>
>
> Ramesh.
>
> -----Original Message-----
> From: James Strachan [mailto:james.strachan@gmail.com]
> Sent: Monday, April 02, 2007 1:27 AM
> To: users@activemq.apache.org
> Subject: Re: JDBC Persistance
>
> On 4/1/07, Ramesh Bobba <ra...@transerainc.com> wrote:
> > I have three producers producing 80K messages every 2 seconds, I have
> > three consumers subscribed as durable consumers. I am using mysql as
> > persistence. What I see is that the messages are being written to the
> > database even when all the subscribers are up.
> >
> > I thought that broker
> > only writes to the datasource if it has to.
>
> It does
>
> If you don't want persistence to take place, don't use persistent
> delivery.
> http://cwiki.apache.org/ACTIVEMQ/what-is-the-difference-between-persiste
> nt-and-non-persistent-delivery.html
>
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


-- 

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

RE: JDBC Persistance

Posted by Ramesh Bobba <ra...@transerainc.com>.
Hi James,

I do want to use persistent delivery. The problem I am seeing is the
messages from the persistent store are not being deleted fast enough. My
disk is getting full. Is there any way to control this? Do you think
setAsyncSend(true) will help?


Thanks,


Ramesh.

-----Original Message-----
From: James Strachan [mailto:james.strachan@gmail.com] 
Sent: Monday, April 02, 2007 1:27 AM
To: users@activemq.apache.org
Subject: Re: JDBC Persistance

On 4/1/07, Ramesh Bobba <ra...@transerainc.com> wrote:
> I have three producers producing 80K messages every 2 seconds, I have
> three consumers subscribed as durable consumers. I am using mysql as
> persistence. What I see is that the messages are being written to the
> database even when all the subscribers are up.
>
> I thought that broker
> only writes to the datasource if it has to.

It does

If you don't want persistence to take place, don't use persistent
delivery.
http://cwiki.apache.org/ACTIVEMQ/what-is-the-difference-between-persiste
nt-and-non-persistent-delivery.html


-- 

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

Re: JDBC Persistance

Posted by James Strachan <ja...@gmail.com>.
On 4/1/07, Ramesh Bobba <ra...@transerainc.com> wrote:
> I have three producers producing 80K messages every 2 seconds, I have
> three consumers subscribed as durable consumers. I am using mysql as
> persistence. What I see is that the messages are being written to the
> database even when all the subscribers are up.
>
> I thought that broker
> only writes to the datasource if it has to.

It does

If you don't want persistence to take place, don't use persistent delivery.
http://cwiki.apache.org/ACTIVEMQ/what-is-the-difference-between-persistent-and-non-persistent-delivery.html


-- 

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