Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 82169 invoked from network); 25 Sep 2008 13:42:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Sep 2008 13:42:57 -0000 Received: (qmail 5481 invoked by uid 500); 25 Sep 2008 13:42:53 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 5462 invoked by uid 500); 25 Sep 2008 13:42:53 -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 5451 invoked by uid 99); 25 Sep 2008 13:42:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Sep 2008 06:42:53 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Sep 2008 13:41:50 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Kir6t-0008Ig-BC for users@activemq.apache.org; Thu, 25 Sep 2008 06:42:23 -0700 Message-ID: <19669786.post@talk.nabble.com> Date: Thu, 25 Sep 2008 06:42:23 -0700 (PDT) From: Joe Fernandez To: users@activemq.apache.org Subject: Re: Activemq5 - Messages redelivered.. In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: joe.fernandez@ttmsolutions.com References: <19667885.post@talk.nabble.com> <19669035.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org If you're not using transactions, then change this session =con.createSession(true,Session.CLIENT_ACKNOWLEDGE); to this session =con.createSession(false,Session.CLIENT_ACKNOWLEDGE); ^^^ Joe titten wrote: > > public void start()throws JMSException{ > try{ > ConnectionFactory factory = template.getConnectionFactory(); > Connection con = factory.createConnection(); > con.start(); > session =con.createSession(true,Session.CLIENT_ACKNOWLEDGE); > MessageConsumer consumer = > session.createConsumer(template.getDefaultDestination()); > consumer.setMessageListener(this); > > > } > catch(JMSException jms){ > jms.printStackTrace(); > } > } > > public void onMessage(Message message){ > if(message!=null){ > try{ > TextMessage txtMessage = (TextMessage)message; > message.acknowledge(); > > } > catch(Exception e){ > e.printStackTrace(); > } > } > > Thanks. > > On Thu, Sep 25, 2008 at 2:59 PM, Joe Fernandez < > joe.fernandez@ttmsolutions.com> wrote: > >> >> Can you post the consuming portion of your code? >> >> Joe >> >> >> titten wrote: >> > >> > Hi. >> > I have tried both >> > session =con.createSession(true,Session.CLIENT_ACKNOWLEDGE); >> > and >> > session =con.createSession(true,Session.AUTO_ACKNOWLEDGE); >> > >> > When using client ack i have specifically added in my onMessageMethod: >> > message.acknowledge(); >> > >> > Thanks. >> > >> > >> > On Thu, Sep 25, 2008 at 1:47 PM, Joe Fernandez < >> > joe.fernandez@ttmsolutions.com> wrote: >> > >> >> >> >> Sounds like an 'ack' related issue. What acknowledge mode are you >> using >> >> for >> >> your consumer? >> >> >> >> Joe >> >> Get a free ActiveMQ user guide @ http://www.ttmsolutions.com >> >> >> >> >> >> titten wrote: >> >> > >> >> > Hi. >> >> > I am having a problem with getting the same messages redelivered to >> my >> >> > client. >> >> > The configuration is Apache ActiveMq5 with pure jdbc mode running >> >> mysql. >> >> > >> >> > The strange thing is that when i was running the my client in the >> same >> >> jvm >> >> > as the broker using spring with a listenerconfiguration the problem >> >> does >> >> > not >> >> > occur. >> >> > I recently created to standalone applications which do either send >> or >> >> > receive messages. >> >> > After creating these applications my consumer application receives >> the >> >> > same >> >> > messages over again.. >> >> > The only difference in code between the first approach and the >> second >> >> is >> >> > that the latter establishes a second jvm which listens for messages >> on >> >> a >> >> > que. >> >> > I have implemented the messagelistener interface and registerred >> this >> >> with >> >> > the consumer. >> >> > I have not at the moment registerred and particular id for my >> consumer. >> >> > Could this be of importance? >> >> > The class being used is the standard ActiveMqQue class. >> >> > >> >> > I hope you are able to help me with this problem. >> >> > >> >> > Lars >> >> > >> >> > >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/Activemq5---Messages-redelivered..-tp19650989p19667885.html >> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Activemq5---Messages-redelivered..-tp19650989p19669035.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Activemq5---Messages-redelivered..-tp19650989p19669786.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.