qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajith Attapattu <rajit...@gmail.com>
Subject Re: Selective message acknowledgment in Java client (and C++ broker)?
Date Tue, 17 Apr 2012 16:16:18 GMT
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
<robbie.gemmell@gmail.com>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 <fraser.adams@blueyonder.co.uk>
> 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<rajith77@gmail.com>
> >>  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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message