Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 80816 invoked from network); 23 Sep 2010 15:09:23 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Sep 2010 15:09:23 -0000 Received: (qmail 99351 invoked by uid 500); 23 Sep 2010 15:09:23 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 99258 invoked by uid 500); 23 Sep 2010 15:09:21 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 99250 invoked by uid 99); 23 Sep 2010 15:09:21 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Sep 2010 15:09:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Sep 2010 15:09:03 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8NF8f1r003758 for ; Thu, 23 Sep 2010 15:08:42 GMT Message-ID: <16277088.29501285254521799.JavaMail.jira@thor> Date: Thu, 23 Sep 2010 11:08:41 -0400 (EDT) From: "James Mason (JIRA)" To: dev@activemq.apache.org Subject: [jira] Commented: (AMQ-2937) kahadb log files not deleted when exceptions are thrown by consumers In-Reply-To: <5998852.29481285254340361.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-2937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62038#action_62038 ] James Mason commented on AMQ-2937: ---------------------------------- I also tested against 5.4.1 and get the same problem > kahadb log files not deleted when exceptions are thrown by consumers > -------------------------------------------------------------------- > > Key: AMQ-2937 > URL: https://issues.apache.org/activemq/browse/AMQ-2937 > Project: ActiveMQ > Issue Type: Bug > Components: Message Store > Affects Versions: 5.4.1 > Environment: OSX 10.5.8, Spring 2.5.6 > Reporter: James Mason > > kahadb log files are not being cleaned up, and are building up over a number of days. I've created a simple test that can reproduce the problem, and it only reproduces the problem if my message consumer throws errors (in the test case they are thrown 1 in 100 times). > The messages are re-consumed, and none of them are added to a DLQ. I can provide the test code if this helps. I'm using AMQ v5.4.0, persistent queues, and using AMQ embedded with Spring. > Test code: > (The test needs to be kept running until several log files have been created) > activemq.xml > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd > http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd > http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> > brokerName="amq-broker" > useJmx="true" > destroyApplicationContextOnStop="true" > useShutdownHook="true"> > > > directory="/data" > indexWriteBatchSize="1000" > enableIndexWriteAsync="true" > enableJournalDiskSyncs="false" /> > > > > > > > > > > > > > > 'Unit' Test (long running test...) > public class AmqKahaDbTest extends IntegrationTestBase { > public void testKahaDbLogs() throws Exception { > for(int i = 0; i < 1000000; i++) { > sendMessage(i); > > Thread.sleep(20); > } > } > > private void sendMessage(final int i) { > jmsTemplate.send(testDestination, new MessageCreator() { > public Message createMessage(Session session) throws JMSException { > MapMessage message = session.createMapMessage(); > > message.setString("testField1", "Test Message " + i); > > return message; > } > }); > } > > private JmsTemplate jmsTemplate; > public void setJmsTemplate(JmsTemplate jmsTemplate) { > this.jmsTemplate = jmsTemplate; > } > > private Destination testDestination; > public void setTestDestination(Destination testDestination) { > this.testDestination = testDestination; > } > } > Message listener: > public class TestMessageListener implements MessageListener { > > public void onMessage(Message message) { > if (message instanceof MapMessage) { > > //read the type of subtask > MapMessage mapMessage = (MapMessage)message; > String messageText; > try { > messageText = mapMessage.getString("testField1"); > long sleepTime = (long)(Math.random() * 100d); > > log.info("Test message consume start, sleep time: " + sleepTime); > > Thread.sleep(sleepTime); > > if(sleepTime == 50) { > //if commented out then the old log files are deleted > throw new RuntimeException("Random error!!!"); > } > > log.info("Test message consume start: " + messageText); > > } catch (Exception e) { > log.error("Error consuming message", e); > throw new RuntimeException(e); > } > > } else { > throw new IllegalArgumentException("Message must be of type Test"); > } > } > > private Logger log = Logger.getLogger(TestMessageListener.class); > } > Spring config: > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.