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 BA1F618E7A for ; Wed, 10 Jun 2015 10:45:47 +0000 (UTC) Received: (qmail 68527 invoked by uid 500); 10 Jun 2015 10:45:47 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 68487 invoked by uid 500); 10 Jun 2015 10:45:47 -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 68476 invoked by uid 99); 10 Jun 2015 10:45:47 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2015 10:45:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A5637C095F for ; Wed, 10 Jun 2015 10:45:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.009 X-Spam-Level: X-Spam-Status: No, score=-0.009 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, SPF_HELO_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id u-pc6Pkpzy9x for ; Wed, 10 Jun 2015 10:45:32 +0000 (UTC) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 7D43224CE5 for ; Wed, 10 Jun 2015 10:45:31 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Z2dVc-0002aq-AS for users@activemq.apache.org; Wed, 10 Jun 2015 12:45:24 +0200 Received: from host-92-27-125-143.static.as13285.net ([92.27.125.143]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Jun 2015 12:45:24 +0200 Received: from nospam.1.friedbadger by host-92-27-125-143.static.as13285.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Jun 2015 12:45:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: users@activemq.apache.org From: spam trap Subject: Re: Allowing another consumer to have a message (ActiveMQ-CPP) Date: Wed, 10 Jun 2015 11:44:59 +0100 Lines: 126 Message-ID: References: <8irdnahig11sv0haggtkk91u2vqqviggah@4ax.com> <8irdnahig11sv0haggtkk91u2vqqviggah-e09XROE/p8c@public.gmane.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: host-92-27-125-143.static.as13285.net X-Newsreader: Forte Agent 3.3/32.846 User-Agent: Hamster/2.1.0.11 On Tue, 9 Jun 2015 10:31:02 -0400, Christopher Shannon wrote: OK. Thanks. Now I am looking at the case where we want messages to be redelivered to the same consumer (assume there is only one consumer of a queue). I have tried stopping and restarting the session and consumer objects but not all messages are redelivered. The following article seems to suggest that you must close the consumer object (http://activemq.apache.org/what-is-the-prefetch-limit-for.html) but if I try this and then attempt to restart it, no messages are consumed at all, even new ones. How can I achieve the latter? Do I need to destroy and recreate the consumer object, for example? >I think the only way you are going to be able to achieve what you want is >by doing what Tim mentioned....using a transaction where you >commit/rollback after each message. Since processing a message could take >a while, you could increase the number of consumers to increase throughput. > > >Take a look at the documentation here: >http://activemq.apache.org/message-redelivery-and-dlq-handling.html for >more info on how messages can be redelivered. > >On Tue, Jun 9, 2015 at 9:51 AM, spamtrap < >nospam.1.friedbadger@spamgourmet.com> wrote: > >> On Tue, 9 Jun 2015 07:29:16 -0600, Tim Bain >> wrote: >> >> >So why can't you use transactions? Won't you get what you want if you >> >commit the transaction after every successful message and >> >rollback()/close() and then reconnect after every failed one? >> >> No. It may take some time to process a message so we operate a >> 'window'. Therefore there would normally be more than one message >> outstanding. >> >> >Also is the app server going to fail to respond to *certain* messages, or >> >is it going to fail to respond to *any* messages? If the latter, you can >> >delay the reconnect till you figure out that the web service is available >> >again. >> >> We have to assume it may fail to respond to certain messages. >> >> >On Tue, Jun 9, 2015 at 7:09 AM, spamtrap < >> >nospam.1.friedbadger@spamgourmet.com> wrote: >> > >> >> On Tue, 9 Jun 2015 06:43:45 -0600, Tim Bain >> >> wrote: >> >> >> >> The situation is that the consumer gets a message from a queue and >> >> then converts into into a different format and sends it to an >> >> application server, which should respond with an acknowledgement >> >> message. If the application server does not respond to a particular >> >> message then we want to be able to allow another ActiveMQ consumer to >> >> pick up the message and send it elsewhere. Any consumer should be >> >> able to process the message so we don't want to use selectors. >> >> >> >> >In this scenario, do you want to consume it twice, or do you really >> want >> >> to >> >> >consume it once but you're picking which consumer gets it? If the >> latter, >> >> >can you use selectors to make sure the right consumer gets the right >> >> >messages? Or maybe an embedded Camel route to send those messages to a >> >> >queue that's specific to the consumer that should get them? >> >> >On Jun 9, 2015 6:00 AM, "spamtrap" < >> nospam.1.friedbadger@spamgourmet.com> >> >> >wrote: >> >> > >> >> >> On Tue, 9 Jun 2015 07:24:24 -0400, Christopher Shannon >> >> >> wrote: >> >> >> >> >> >> >The use case you are trying to achieve is probably best done by >> using a >> >> >> >transaction instead of individual acknowledgements. If you call >> >> rollback >> >> >> >on the session then the message would be available to be >> redelivered to >> >> >> >another consumer. >> >> >> >> >> >> I don't think I can use a transaction because all messages are >> >> >> committed at once. We need to be able to select which messages may >> be >> >> >> redelivered and which not, hence the individual acknowledge mode is >> >> >> used. >> >> >> >> >> >> Will the rollback work with individual acknowledgements? >> >> >> >> >> >> >> >> >> > >> >> >> >On Tue, Jun 9, 2015 at 3:50 AM, spamtrap < >> >> >> >nospam.1.friedbadger@spamgourmet.com> wrote: >> >> >> > >> >> >> >> Hi, >> >> >> >> >> >> >> >> In some cases we want to allow another consumer to consumer a >> message >> >> >> >> that has already been consumed. The session is opened using >> >> >> >> INDIVIDUAL_ACKNOWLEDGE and the message has not been >> acknowledged. I >> >> >> >> have tried closing the session where the message has been consumed >> >> but >> >> >> >> the message is not available to the other consumer. How can I >> >> achieve >> >> >> >> what I need? >> >> >> >> >> >> >> >> TIA. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>