You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by adirubin <ad...@gmail.com> on 2018/02/12 16:39:54 UTC

ARTEMIS - Selector modification

Hi, I'm using Artemis 2.3 via JMS.
I have a durable shared subscription to a topic, with some selector
(filter). I would like to change the selector at runtime without
re-subscribing.

I've found some forum threads regarding ActiveMQ (not artemis) that suggest
it is possible using jmx:
http://activemq.2283324.n4.nabble.com/Changing-Message-Selector-td2347256.html

Is there any such api for artemis? Or any other solution?


My use case in detail: I have a highly-available application subscribed to a
topic (a cluster of 2 or more webservers, using shared subscription). The
app would like to receive only a subset of the messages, but may be upgraded
to handle additional types. The application must be constantly on-line, so
the servers are upgraded one at a time. Once a server is upgraded, it'll
attempt to create a durable sared consumer, but with a different selector,
and will fail.

Thanks,
Adi Rubin







--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: ARTEMIS - Selector modification

Posted by adirubin <ad...@gmail.com>.
Hi Justin, thanks for the response!
My current solution is to mark the messages at the publisher side as "for
app 1", "for app 2" etc, which kinda defeats the purpose of the publisher
being agnostic to subscribers.
Perhaps there's another way?

Thanks again,
Adi



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: ARTEMIS - Selector modification

Posted by Justin Bertram <jb...@apache.org>.
In Artemis when a JMS consumer creates a subscription on a topic it creates
a queue on the broker.  If the subscription has a selector then the queue
on the broker is created with a corresponding "filter".  The filter on a
queue is immutable so there's no way to change the subscription's
selector.  You'd have to create a new subscription with the new selector
and *then* drop the old one so that you don't miss any messages.


Justin

On Mon, Feb 12, 2018 at 10:39 AM, adirubin <ad...@gmail.com> wrote:

> Hi, I'm using Artemis 2.3 via JMS.
> I have a durable shared subscription to a topic, with some selector
> (filter). I would like to change the selector at runtime without
> re-subscribing.
>
> I've found some forum threads regarding ActiveMQ (not artemis) that suggest
> it is possible using jmx:
> http://activemq.2283324.n4.nabble.com/Changing-Message-
> Selector-td2347256.html
>
> Is there any such api for artemis? Or any other solution?
>
>
> My use case in detail: I have a highly-available application subscribed to
> a
> topic (a cluster of 2 or more webservers, using shared subscription). The
> app would like to receive only a subset of the messages, but may be
> upgraded
> to handle additional types. The application must be constantly on-line, so
> the servers are upgraded one at a time. Once a server is upgraded, it'll
> attempt to create a durable sared consumer, but with a different selector,
> and will fail.
>
> Thanks,
> Adi Rubin
>
>
>
>
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-
> f2341805.html
>