Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 191D311315 for ; Tue, 15 Jul 2014 04:57:55 +0000 (UTC) Received: (qmail 43125 invoked by uid 500); 15 Jul 2014 04:57:54 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 43081 invoked by uid 500); 15 Jul 2014 04:57:54 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 43067 invoked by uid 99); 15 Jul 2014 04:57:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jul 2014 04:57:54 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_HELO_PASS,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of uttara.chevale@gmail.com does not designate 162.253.133.43 as permitted sender) Received: from [162.253.133.43] (HELO mwork.nabble.com) (162.253.133.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jul 2014 04:57:51 +0000 Received: from mjoe.nabble.com (unknown [162.253.133.57]) by mwork.nabble.com (Postfix) with ESMTP id 136AA1E0707 for ; Mon, 14 Jul 2014 21:56:52 -0700 (PDT) Date: Mon, 14 Jul 2014 21:57:26 -0700 (PDT) From: Uttara To: users@activemq.apache.org Message-ID: <1405400246675-4683265.post@n4.nabble.com> In-Reply-To: <53C404C8.8050906@gmail.com> References: <1405345144884-4683240.post@n4.nabble.com> <53C404C8.8050906@gmail.com> Subject: Re: Lost messages - Abnormal Behaviour of activeMQ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Tim, Thanks for your reply,We are using Individual acknowledgement. Actually three threads run in the background for three customers.And from the queue we read the message based on the customer id in the message . If the intended thread receives the message it acknowledges it. We are also logging once after the message is read before acknowledging it. In certain scenarios the message is being read in other two customer threads but not for the intended customer as we could see the log points before acknowledging it. And then to my surprise,the message gets lost. PFB the piece of code where we have applied acknowledging strategy. for(int count=0;count<10;count++){ Object receivedMessage = queueReceiver.receiveNoWait(); if(receivedMessage instanceof TextMessage) { message = (TextMessage) receivedMessage; try { objMsgVO = util.convertMessageToVO(message.getText()); } catch (Throwable e) { logger.error("Invalid Json ticket data.Going to Acknowledge"); message.acknowledge(); } if(objMsgVO.getCustomerId()!=null){ boolean flag=false; for(int i=0,j=0;i