Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-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 9E8CD99E6 for ; Tue, 17 Apr 2012 16:16:46 +0000 (UTC) Received: (qmail 99946 invoked by uid 500); 17 Apr 2012 16:16:46 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 99900 invoked by uid 500); 17 Apr 2012 16:16:46 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 99892 invoked by uid 99); 17 Apr 2012 16:16:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2012 16:16:46 +0000 X-ASF-Spam-Status: No, hits=3.1 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rajith77@gmail.com designates 74.125.82.170 as permitted sender) Received: from [74.125.82.170] (HELO mail-we0-f170.google.com) (74.125.82.170) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2012 16:16:40 +0000 Received: by werh12 with SMTP id h12so4551398wer.15 for ; Tue, 17 Apr 2012 09:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=QHqWc6hnyEXBO7qPaZjwbdOjTz885eLg/eZOfubZA48=; b=O06Cbb1XzYN4qbFOe3OedoC1KFQ6KDm7lMokfZRKKdzlSvytbDOCes2shuzaIy8tqO CPx4Pv4YfpZpv8uT2OTM9jVRKruxd6qqIaRHjhBACVyo4fmt1J6zdBC+NtbYPdwkrnMS UYKdxh63ePluUB1DtaNmAswLKRN4BJ88D/8FDPf7nr8gqm307YDDtWLiTE3y/GGrxMm2 hgzENz+fQKYZe/5HcpLH1+VrWAvXUKfViPWofHW3xtwl5dHoqIQ4NNS6VZEoDT2BGNkI OHkMeCA7IOpu2+ML2jLa9sA53Ws5996QJR/ETjbPOXX5mBVRvqEiBpeQYLEolc6BqnxV Ckcg== MIME-Version: 1.0 Received: by 10.180.95.129 with SMTP id dk1mr34234191wib.3.1334679378711; Tue, 17 Apr 2012 09:16:18 -0700 (PDT) Received: by 10.216.38.1 with HTTP; Tue, 17 Apr 2012 09:16:18 -0700 (PDT) In-Reply-To: References: <532c36b6-a6c4-4905-b3fd-d39ec31839a4@zmail02.collab.prod.int.phx2.redhat.com> <4f88a586-0276-4fdc-a191-416b58d00c81@zmail02.collab.prod.int.phx2.redhat.com> <4F897E97.40903@blueyonder.co.uk> Date: Tue, 17 Apr 2012 12:16:18 -0400 Message-ID: Subject: Re: Selective message acknowledgment in Java client (and C++ broker)? From: Rajith Attapattu To: users@qpid.apache.org Content-Type: multipart/alternative; boundary=f46d0444ee2d41d4ab04bde2424a X-Virus-Checked: Checked by ClamAV on apache.org --f46d0444ee2d41d4ab04bde2424a Content-Type: text/plain; charset=ISO-8859-1 I'm currently on vacation and has very limited access to email. Thanks Robbie for picking this up. Rajith On Sat, Apr 14, 2012 at 11:44 AM, Robbie Gemmell wrote: > You probably want to try the 0.16 RCs or trunk if you are interested > in using the client-side selector support (available when connecting > to AMQP 0-10 brokers) of the Java client, as several related changes > were made to that area since Qpid 0.14 (in order to improve > efficiency/correctness when connecting to the Java broker). > > Although the Java broker performs server-side selection, the clients > AMQP 0-10 support was originally only used with the C++ broker which > currently does not. As a result the client was previously still > enabling its own selection support when connected to the Java broker > using AMQP 0-10, which made it incurr unecessary overheads as a > result. When addressing this by making the client able to disable the > client-side selection when connected to the Java broker, the > implementation in this area was cleaned up in general and multiple > defects with the client-side selection support were addressed in the > process. These likely play right into what you have observed > previously, so its worth testing with an up to date client version if > you havent already. If you still have issues when you do, raise a JIRA > and attach your reproducer. > > 0.16 RC2: > http://people.apache.org/~jross/qpid-0.16-rc2/ > > Trunk nightly client build: > > https://builds.apache.org/view/M-R/view/Qpid/job/Qpid-Java-Artefact-Release/lastSuccessfulBuild/artifact/trunk/qpid/java/client/release/ > > Robbie > > On 14 April 2012 14:41, Fraser Adams > wrote: > > Hi Pavel/Jakub/Rajith > > I posted ages back (March 2011) that I didn't believe that JMS Message > > Selectors were behaving correctly: > > > http://qpid.2158936.n2.nabble.com/JMS-Message-Selectors-Behaving-Strangely-td6158445.html > > > > My observations concur with the observations of Pavel and Jakob namely > I'd > > expect any unselected messages to remain on the queue, but not the > messages > > that matched the selector. > > > > For info guys one approach that just may be useful is that the "internal" > > filter class is fairly easily accessibly so I had code that looks like. > > > > ... > > import org.apache.qpid.filter.JMSSelectorFilter; > > import org.apache.qpid.client.message.AbstractJMSMessage; > > ... > > > > private JMSSelectorFilter filter; > > .... > > // Then roundabouts where you'd create a consumer using a message > selector > > do.. > > // Clearly just an example but this selects a header called amqp-delivery > > with the value fadams > > // any selector could be used. > > filter = new JMSSelectorFilter("amqp-delivery = 'fadams'"); > > ..... > > // Later in say onMessage(Message message) > > .... > > if (filter.matches((AbstractJMSMessage)message)) { > > // Logic for matching message. > > > > } > > ... > > > > Clearly the code above isn't ideal as it isn't pure JMS and also it uses > > internal classes that could change, but it's the closest approximation > that > > I could get to using message selectors that gave me some finer control. > > > > > > Hope this helps you guys. I'd really like to see selectors behaving in a > way > > that acknowledges selected messages and leaves unselected messages on the > > queue, this is what I'd intuitively expect to happen. > > > > If that's not possible at the least it would be nice to have the > > JMSSelectorFilter exposed as an "official" Qpid API so it could be used > > without fear of it suddenly disappearing. > > > > I'd be interested in thoughts on this, I've been meaning to bring it up > > again but have been distracted on other things. > > > > Frase > > > > > > > > On 13/04/12 08:55, Jakub Scholz wrote: > >> > >> Hi Rajith, > >> > >> I was playing with the JMS selectors last week. While they do work and > >> really select the messages based on the filter, it seemed to me that > >> it switched off the acknowledgments completely. The Java application > >> was getting only the selected messages, but I was unable to > >> acknowledge them and they stayed in the queues. This may be OK in some > >> situations, but in my case I wanted to get the messages really > >> acknowledged and removed from the queues on the broker. > >> > >> Then I considered to try the same trick as Pavel did - read all > >> messages and filter them manually. But unlike in the C++ API, I didn't > >> found any methods for acknowledging specific message as well as for > >> releasing or rejecting a message. > >> > >> Regards > >> Jakub > >> > >> On Fri, Apr 13, 2012 at 07:43, Rajith Attapattu > >> wrote: > >>> > >>> (Note for C++ broker we do client side selectors, which does exactly > what > >>> you have described). > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org > >> For additional commands, e-mail: users-help@qpid.apache.org > >> > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org > > For additional commands, e-mail: users-help@qpid.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org > For additional commands, e-mail: users-help@qpid.apache.org > > --f46d0444ee2d41d4ab04bde2424a--