ARTEMIS - Selector modification

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ARTEMIS - Selector modification

adirubin
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
Reply | Threaded
Open this post in threaded view
|

Re: ARTEMIS - Selector modification

jbertram
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 <[hidden email]> 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
>
Reply | Threaded
Open this post in threaded view
|

Re: ARTEMIS - Selector modification

adirubin
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