activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: derby db using up lot of disk space
Date Fri, 06 Apr 2007 08:13:28 GMT
On 4/5/07, Suchitha Koneru (sukoneru) <sukoneru@cisco.com> wrote:
> Thank you James and Hemant for the information.
> I am using an embedded broker in Tomcat 5.520.  The embedded broker is
> started by a servlet context listener.
>
>
>
> Is there a way I can access the derby db , which is internally
> maintained by the active mq embedded broker ?

No, unless via java code thats embedded


> Also, In case of a embedded broker, how will I switch to a different
> data base (MySQl or PsotGreSQl).
> Please give a link to relevant documentation.

Use the xml config; see the activemq.xml in the release
http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html

>
>
>
>
> Thanks,
> Suchitha
>
>
> -----Original Message-----
> From: Hemant Gaur [mailto:hgaur@interwoven.com]
> Sent: Thursday, April 05, 2007 6:44 AM
> To: users@activemq.apache.org
> Subject: RE: derby db using up lot of disk space
>
> Derby DB used for long time/more publishes needs to be compressed even
> when the tables have lesser data.
> A Derby table or index (sometimes called a conglomerate) can contain
> unused space after large amounts of data have been deleted or updated.
> This happens because, by default, Derby does not return unused space to
> the operating system. After a page has been allocated to a table or
> index, Derby does not automatically return the page to the operating
> system until the table or index is dropped, even if the space is no
> longer needed.
> However, Derby does provide a way to reclaim unused space in tables and
> associated indexes.
> ij> call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('USR', 'MESSAGES', 1);
> 0 rows inserted/updated/deleted
> ij> call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('USR', 'MESSAGE_HANDLES', 1);
> 0 rows inserted/updated/deleted
>
> --hemant gaur
>
>
> -----Original Message-----
> From: James Strachan [mailto:james.strachan@gmail.com]
> Sent: Thursday, April 05, 2007 6:35 PM
> To: users@activemq.apache.org
> Subject: Re: derby db using up lot of disk space
>
> I'd recommend switching to a more traditional database like MySQL or
> Postgresql for production usage. Or switch to AMQStore in 4.2
>
> On 4/4/07, Suchitha Koneru (sukoneru) <sukoneru@cisco.com> wrote:
> > Hello Active MQ Users,
> >                      I am using active mq 4.0,.2. I am using a durable
>
> > subscriber and topic publisher with non present mode of delivery. The
> > derby db  has grown to be of the size of 13 GB. is this a bug in 4.0.2
> ?
> > has any one of you encountered such a problem. This is using up all
> the
> > disk space. Please let me know. The code snippets for publisher and
> > subscriber are as follows
> >
> > // publisher code
> > tc = getConn();
> >
> > Sess = getSession(tc);
> >
> > topic = getTopic();
> >
> > logger.info("the sender topic is :"+topic);
> >
> > try{
> >
> > pub = Sess.createPublisher(topic);
> >
> > if(pub != null){
> >
> > pub.setTimeToLive(300000);
> >
> > pub.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
> >
> > tc.start();
> >
> > }else{
> >
> > logger.error("JMS Event sender , publisher is null");
> >
> > }
> >
> > // subscriber code
> > public TopicSubscriber createSubscriber() {
> >
> > try {
> >
> > String durableSusbscriptionName =
> > jmsProperties.getProperty(DURABLE_SUBSCRIPTION_NAME);
> >
> > Subs = Sess.createDurableSubscriber(topic, durableSusbscriptionName);
> >
> > Subs.setMessageListener(new JmsMessageListener());
> >
> > }catch(Exception ex) {
> >
> > logger.error("Exception while creating subscriber for topic " +
> > ex.getMessage());
> >
> > ex.printStackTrace();
> >
> > }
> >
> > return Subs;
> >
> > }
> >
> > class JmsMessageListener implements MessageListener {
> >
> > public void onMessage(Message m) {
> >
> > try {
> >
> > HerbieEvent evt = null;
> >
> > if(m instanceof ActiveMQObjectMessage){
> >
> > ActiveMQObjectMessage obj = (ActiveMQObjectMessage) m;
> >
> > HerbieEvent event = (HerbieEvent) obj.getObject();
> >
> > System.out.println(event.getMessage());
> >
> > }
> >
> > }
> >
> > }else {
> >
> > // Not a relevent Herbie event, ignore
> >
> > }
> >
> > }catch(Exception ex) {
> >
> > logger.error("ERROR: while receiving event "+ex.getMessage());
> >
> > ex.printStackTrace();
> >
> > }
> >
> > }
> >
> > }
> >
> >
> >
>
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


-- 

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

Mime
View raw message