Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 24186 invoked from network); 25 Sep 2008 14:28:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Sep 2008 14:28:12 -0000 Received: (qmail 79944 invoked by uid 500); 25 Sep 2008 14:28:10 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 79728 invoked by uid 500); 25 Sep 2008 14:28:09 -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 79717 invoked by uid 99); 25 Sep 2008 14:28:09 -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 07:28:09 -0700 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of larseirik@gmail.com designates 74.125.78.149 as permitted sender) Received: from [74.125.78.149] (HELO ey-out-1920.google.com) (74.125.78.149) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Sep 2008 14:27:06 +0000 Received: by ey-out-1920.google.com with SMTP id 21so145318eyc.26 for ; Thu, 25 Sep 2008 07:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=LaK0HfZx1bf+aG53ALlGmJhth5TZG0DHLT8SWTG//T8=; b=mkfXcnxICY2dlgbSJ0Lxo5NSJ9ft1qLSW0m5oREv6f98hfT3l/UZd9mhLUNx4+4ZiO K1xNeMK4QpVbP8zVWmyq3IdwOjZCc3C3gbcp6bvTafji0OeGoPJvV2v2U1iX/d3cJOn3 j87JDlMMw7kgmeKkXTkfykAAoz/5/27x3X2cw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=EhVKwcCcVZ3duzIc/OaRmb76sGI29xaZ7fG7OcSqsTWPf+GGAGpOdOgQpzDqubvlDA mFIqc5sUk1ACGRqRF3uxTP2dayhcN3ijRJobq82z3UhEhjEZcCBVX7EUugJi6FM/Q+Ro w8/n5Y6dWttORIp/kcv4yqhrVH9y7WEW0dlhY= Received: by 10.210.11.13 with SMTP id 13mr6363985ebk.74.1222352859049; Thu, 25 Sep 2008 07:27:39 -0700 (PDT) Received: by 10.210.141.5 with HTTP; Thu, 25 Sep 2008 07:27:38 -0700 (PDT) Message-ID: Date: Thu, 25 Sep 2008 16:27:38 +0200 From: "=?ISO-8859-1?Q?Lars_Eirik_R=F8nning?=" To: users@activemq.apache.org Subject: Re: Activemq5 - Messages redelivered.. In-Reply-To: <19669786.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8090_15217404.1222352858988" References: <19667885.post@talk.nabble.com> <19669035.post@talk.nabble.com> <19669786.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_8090_15217404.1222352858988 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks so much! You truelly rock! On Thu, Sep 25, 2008 at 3:42 PM, Joe Fernandez < joe.fernandez@ttmsolutions.com> wrote: > > 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. > > ------=_Part_8090_15217404.1222352858988--