You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Sam Roberts <vi...@gmail.com> on 2013/05/31 21:55:38 UTC

How to do server side filtering of msgs in topic queues, through STOMP?

For those familiar, this is like AMQP's topics, with a "a.b.#" at the
end of subcription pattern, or of Redis PSUBSCRIBE with "a.b.*", or
whatever. I want matching on whole words, but if it only prefix
matches are possible, I guess that's OK, I can cleanup a bit on
reception.

I'm looking to subscribe to quotes with patterns like 'a.b' match
'a.b.c' and 'a.b', but not 'a', 'a.c', or 'a.bad'.

I suspect I can use the "selector:" header, and publish with a header like:

   topickey: a.b.c

and then subscribe with

  selector: topickey LIKE 'a.b.%' OR topickey = 'a.b'

Am I going down the right path here, or is there more direct support for this?

Thanks,
Sam

Re: How to do server side filtering of msgs in topic queues, through STOMP?

Posted by Sam Roberts <vi...@gmail.com>.
On Mon, Jun 3, 2013 at 7:21 AM, Christian Posta
<ch...@gmail.com> wrote:
> Can you give it a shot with using wildcard subscriptions? The wildcards
> defined on this wiki also work for STOMP subscriptions;
>
> http://activemq.apache.org/wildcards.html

Looks perfect, but I have no idea how to use those wildcards with
STOMP, where do they go?

In the queue name?

   PUBLISH /topic/myPrices/price.groceries.apples
   SUBSCRIBE /topic/myPrices/price.groceries.>

Or is it supposed to be used in the selector: header? Somewhere else?

Thanks,
Sam

Re: How to do server side filtering of msgs in topic queues, through STOMP?

Posted by Christian Posta <ch...@gmail.com>.
Can you give it a shot with using wildcard subscriptions? The wildcards
defined on this wiki also work for STOMP subscriptions;

http://activemq.apache.org/wildcards.html


On Fri, May 31, 2013 at 12:55 PM, Sam Roberts <vi...@gmail.com> wrote:

> For those familiar, this is like AMQP's topics, with a "a.b.#" at the
> end of subcription pattern, or of Redis PSUBSCRIBE with "a.b.*", or
> whatever. I want matching on whole words, but if it only prefix
> matches are possible, I guess that's OK, I can cleanup a bit on
> reception.
>
> I'm looking to subscribe to quotes with patterns like 'a.b' match
> 'a.b.c' and 'a.b', but not 'a', 'a.c', or 'a.bad'.
>
> I suspect I can use the "selector:" header, and publish with a header like:
>
>    topickey: a.b.c
>
> and then subscribe with
>
>   selector: topickey LIKE 'a.b.%' OR topickey = 'a.b'
>
> Am I going down the right path here, or is there more direct support for
> this?
>
> Thanks,
> Sam
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta