From users-return-31333-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Wed Jul 18 19:20:49 2012 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 8C8E2DB1A for ; Wed, 18 Jul 2012 19:20:49 +0000 (UTC) Received: (qmail 41983 invoked by uid 500); 18 Jul 2012 19:20:49 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 41958 invoked by uid 500); 18 Jul 2012 19:20:49 -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 41948 invoked by uid 99); 18 Jul 2012 19:20:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jul 2012 19:20:49 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 194.35.218.66 is neither permitted nor denied by domain of Alistair.Young@uhi.ac.uk) Received: from [194.35.218.66] (HELO gwsmtp.uhi.ac.uk) (194.35.218.66) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jul 2012 19:20:44 +0000 Received: from UHI-OUT-MTA by gwsmtp.uhi.ac.uk with Novell_GroupWise; Wed, 18 Jul 2012 20:20:21 +0100 Message-Id: <50071A7C0200008A0004E630@gwsmtp.uhi.ac.uk> X-Mailer: Novell GroupWise Internet Agent 8.0.2 Date: Wed, 18 Jul 2012 20:20:12 +0100 From: "Alistair Young" To: Subject: Re: Searching for a particular message in a topic Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part4F7E157C.0__=" X-Virus-Checked: Checked by ClamAV on apache.org --=__Part4F7E157C.0__= Content-Type: multipart/alternative; boundary="=__Part4F7E157C.1__=" --=__Part4F7E157C.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable thank you - that's been a helpful exchange. Looks like the JMX route = should be fine for my needs. cheers, Alistair mov eax,1 mov ebx,0 int 80h >>> Gary Tully 18/07/12 4:51 PM >>> inline On 18 July 2012 16:13, Alistair Young wrote: > From what I've read a durable queue keeps all the messages from day 1 so = any > new subscriber will get all messages ever sent to the queue, > With a virtual topic, a new subscriber will create a new queue and only get messages from that point on. > which I'd > rather not do, so I use durable topics and durable subscribers for each > topic. > If you are using durable subs, there is already a browse method on org.apache.activemq.broker.jmx.DurableSubscriptionView#browse I have not used that but It is part way to what you want. which seems to be what you say below :-) > I'm actually not that sure where something like jconsole interacts with > activemq, e.g. when you perform the browse messages operation, where = could I > hook JPDA to in the activemq class hierarchy to see how JMX gets hold of = the > messages still in the topic, e.g. while the consumer is offline. That = would > seem to be a possible option. I can see message content in jconsole so I > suppose a JMX based client could do the querying using browse messages. Peek at org.apache.activemq.broker.jmx.DurableSubscriptionView > > > Alistair > > > > mov eax,1 > mov ebx,0 > int 80h > >>>> Gary Tully 18/07/12 4:01 PM >>> > > For a topic subscription, the prefetch buffer is not maintained in > memory by the broker, so you would need prefetch=3D0 which is a little > odd for a topic. > Would a queue not be better for this use case? Or a virtual topic, > where each consumer gets its own queue. > > On 18 July 2012 15:17, Alistair Young wrote: >> Perhaps getting at the prefetch buffer would prolly be better in that >> case. >> Would you have a pointer on how to access it? >> >> Use case is a consumer that populates Active Directory and uses auto >> acknowledge. If the AD bit slows down for any reason the topic should = fill >> up with messages and I need to provide a way for the support team to = see >> if >> an account is in the 'queue', i.e. it's been sent to the broker but not >> been >> consumed yet. The query will be based on a userid which is contained in >> the >> message body. Of course I might have missed an entirely easier way of >> doing >> it. It's in conjunction with Camel routing so I could prolly do = something >> with a Processor or fancy logging but for the most part the consumer >> rarely >> slows down and logging thousands of usernames seems a bit over the top = on >> the off chance one might be queried. >> >> >> Alistair >> >> >> >> mov eax,1 >> mov ebx,0 >> int 80h >> >>>>> Gary Tully 18/07/12 3:05 PM >>> >> >> you would be on the right track. >> you will need to lock the pending cursor for the duration of the >> iteration so that will be a little expensive. >> >> the pending cursor only gets filled when the prefetch buffer is >> filled, so you would need a low prefetch and a slow consumer if you >> expect to find messages in there. >> What is the use case here? >> >> On 18 July 2012 14:46, Alistair Young wrote: >>> would I be on the right path if I implemented it in TopicSubscriptionVi= ew >>> and making use of PendingMessageCursor from TopicSubscription to get = at >>> the >>> pending messages and their content and properties? Or is iterating >>> PendingMessageCursor expensive? >>> >>> >>> Alistair >>> >>> >>> mov eax,1 >>> mov ebx,0 >>> int 80h >>> >>>>>> Gary Tully 18/07/12 1:16 PM >>> >>> >>> that feature does not exist, it would require some extension to >>> org.apache.activemq.broker.jmx.TopicSubscriptionView >>> >>> On 18 July 2012 11:21, Alistair Young wrote: >>>> Is there a way to find a particular message in a topic, either via a >>>> header >>>> name/value or based on message content? e.g. if I have a message I = know >>>> may >>>> be in the topic and it has a message body that would match a = particular >>>> regex, or has a header name with a particular value, is it possible = to >>>> find >>>> it and therefore verify it's in the topic, i.e. it's in the backlog >>>> waiting >>>> to be consumed? >>>> >>>> thanks, >>>> >>>> Alistair >>>> >>>> >>>> mov eax,1 >>>> mov ebx,0 >>>> int 80h >>>> >>> >>> >>> >>> -- >>> http://fusesource.com >>> http://blog.garytully.com >> >> >> >> -- >> http://fusesource.com >> http://blog.garytully.com > > > > -- > http://fusesource.com > http://blog.garytully.com --=20 http://fusesource.com http://blog.garytully.com --=__Part4F7E157C.1__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML thank you - that's been a helpful exchange. Looks like = the JMX route should be fine for my needs.

cheers,

Alistair


mov eax,1
mov ebx,0
int = 80h

>>> Gary Tully <gary.tully@gmail.com> = 18/07/12 4:51 PM >>>
inline

On 18 July 2012 16:13, = Alistair Young <Alistair.Young@uhi.ac.uk> wrote:
> From what = I've read a durable queue keeps all the messages from day 1 so any
> = new subscriber will get all messages ever sent to the queue,
>
Wit= h a virtual topic, a new subscriber will create a new queue and
only = get messages
from that point on.

> which I'd
> rather = not do, so I use durable topics and durable subscribers for each
> = topic.
>
If you are using durable subs, there is already a browse = method on
org.apache.activemq.broker.jmx.DurableSubscriptionView#browse<= br>
I have not used that but It is part way to what you want. which = seems
to be what you say below :-)

> I'm actually not that = sure where something like jconsole interacts with
> activemq, e.g. = when you perform the browse messages operation, where could I
> hook = JPDA to in the activemq class hierarchy to see how JMX gets hold of = the
> messages still in the topic, e.g. while the consumer is = offline. That would
> seem to be a possible option. I can see = message content in jconsole so I
> suppose a JMX based client could = do the querying using browse messages.

Peek at org.apache.activemq.b= roker.jmx.DurableSubscriptionView

>
>
> Alistair
&= gt;
>
>
> mov eax,1
> mov ebx,0
> int = 80h
>
>>>> Gary Tully <gary.tully@gmail.com> = 18/07/12 4:01 PM >>>
>
> For a topic subscription, = the prefetch buffer is not maintained in
> memory by the broker, so = you would need prefetch=3D0 which is a little
> odd for a topic.
&= gt; Would a queue not be better for this use case? Or a virtual topic,
&= gt; where each consumer gets its own queue.
>
> On 18 July = 2012 15:17, Alistair Young <Alistair.Young@uhi.ac.uk> wrote:
>&= gt; Perhaps getting at the prefetch buffer would prolly be better in = that
>> case.
>> Would you have a pointer on how to = access it?
>>
>> Use case is a consumer that populates = Active Directory and uses auto
>> acknowledge. If the AD bit = slows down for any reason the topic should fill
>> up with = messages and I need to provide a way for the support team to see
>>= ; if
>> an account is in the 'queue', i.e. it's been sent to the = broker but not
>> been
>> consumed yet. The query will = be based on a userid which is contained in
>> the
>> = message body. Of course I might have missed an entirely easier way = of
>> doing
>> it. It's in conjunction with Camel = routing so I could prolly do something
>> with a Processor or = fancy logging but for the most part the consumer
>> rarely
>= > slows down and logging thousands of usernames seems a bit over the = top on
>> the off chance one might be queried.
>>
>= >
>> Alistair
>>
>>
>>
>> = mov eax,1
>> mov ebx,0
>> int 80h
>>
>>= >>> Gary Tully <gary.tully@gmail.com> 18/07/12 3:05 PM = >>>
>>
>> you would be on the right track.
&g= t;> you will need to lock the pending cursor for the duration of = the
>> iteration so that will be a little expensive.
>>>> the pending cursor only gets filled when the prefetch buffer = is
>> filled, so you would need a low prefetch and a slow = consumer if you
>> expect to find messages in there.
>> = What is the use case here?
>>
>> On 18 July 2012 14:46, = Alistair Young <Alistair.Young@uhi.ac.uk> wrote:
>>> = would I be on the right path if I implemented it in TopicSubscriptionView>>> and making use of PendingMessageCursor from TopicSubscriptio= n to get at
>>> the
>>> pending messages and their = content and properties? Or is iterating
>>> PendingMessageCurso= r expensive?
>>>
>>>
>>> Alistair
&g= t;>>
>>>
>>> mov eax,1
>>> mov = ebx,0
>>> int 80h
>>>
>>>>>> = Gary Tully <gary.tully@gmail.com> 18/07/12 1:16 PM >>>
&g= t;>>
>>> that feature does not exist, it would require = some extension to
>>> org.apache.activemq.broker.jmx.TopicSubsc= riptionView
>>>
>>> On 18 July 2012 11:21, = Alistair Young <Alistair.Young@uhi.ac.uk> wrote:
>>>> = Is there a way to find a particular message in a topic, either via = a
>>>> header
>>>> name/value or based on = message content? e.g. if I have a message I know
>>>> = may
>>>> be in the topic and it has a message body that = would match a particular
>>>> regex, or has a header name = with a particular value, is it possible to
>>>> find
>= >>> it and therefore verify it's in the topic, i.e. it's in the = backlog
>>>> waiting
>>>> to be consumed?
= >>>>
>>>> thanks,
>>>>
>>= ;>> Alistair
>>>>
>>>>
>>>&= gt; mov eax,1
>>>> mov ebx,0
>>>> int = 80h
>>>>
>>>
>>>
>>>
= >>> --
>>> http://fusesource.com
>>> = http://blog.garytully.com
>>
>>
>>
>> = --
>> http://fusesource.com
>> http://blog.garytully.com<= br>>
>
>
> --
> http://fusesource.com
> = http://blog.garytully.com



--
http://fusesource.com
ht= tp://blog.garytully.com
--=__Part4F7E157C.1__=-- --=__Part4F7E157C.0__=--