[
https://issues.apache.org/jira/browse/ARTEMIS-1802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17836402#comment-17836402
]
Justin Bertram edited comment on ARTEMIS-1802 at 4/12/24 3:16 AM:
------------------------------------------------------------------
Taking another look at this...
I think you should be able to accomplish your goal without any changes to the
broker.
bq. First, I need to be able to subscribe to the topic to receive messages
without interfering with the queues.
You should be able to treat the address {{foo}} like a topic and subscribe to
it. This should create a _new_ queue for the subscription (i.e. without
interfering with the existing queues).
bq. Then, I need to be able to send messages directly to one queue without
interfering with the other.
You can do this using the [fully qualified queue
name|https://activemq.apache.org/components/artemis/documentation/latest/address-model.html#fully-qualified-queue-names]
(i.e. {{foo::foo-test}} or {{foo::foo-prod}}).
Generally speaking, all the virtual destination functionality from Classic
should be available in Artemis since it is essentially baked into the address
model.
was (Author: jbertram):
Taking another look at this...
I think you should be able to accomplish your goal without any changes to the
broker.
bq. First, I need to be able to subscribe to the topic to receive messages
without interfering with the queues.
You should be able to treat the address {{foo}} like a topic and subscribe to
it. This should create a _new_ queue for the subscription (i.e. without
interfering with the existing queues).
bq. Then, I need to be able to send messages directly to one queue without
interfering with the other.
You can do this using the fully qualified queue name (i.e. {{foo::foo-test}} or
{{foo::foo-prod}}).
Generally speaking, all the virtual destination functionality from Classic
should be available in Artemis since it is essentially baked into the address
model.
> Cannot use the same name for a divert and an address
> ----------------------------------------------------
>
> Key: ARTEMIS-1802
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1802
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Affects Versions: 2.5.0
> Reporter: Lionel Cons
> Priority: Minor
>
> I'm trying to use diverts to emulate ActiveMQ 5's virtual destinations
> (http://activemq.apache.org/virtual-destinations.html). The use case is a
> single topic ({{foo}}) bound to two queues ({{foo-test}} and {{foo-prod}}).
> The following configuration snippet almost works:
> {code:xml}
> <addresses>
> <!-- the receiving topic "foo" -->
> <address name="foo">
> <multicast/>
> </address>
> <!-- the backend queue "test" -->
> <address name="foo-test">
> <anycast>
> <queue name="foo-test"/>
> </anycast>
> </address>
> <!-- the backend queue "prod" -->
> <address name="foo-prod">
> <anycast>
> <queue name="foo-prod"/>
> </anycast>
> </address>
> ...
> </addresses>
> <diverts>
> <!-- the divert to copy from "foo" to "foo-test" -->
> <divert name="foo-test">
> <address>foo</address>
> <forwarding-address>foo-test</forwarding-address>
> <exclusive>false</exclusive>
> </divert>
> <!-- the divert to copy from "foo" to "foo-prod" -->
> <divert name="foo-prod">
> <address>foo</address>
> <forwarding-address>foo-prod</forwarding-address>
> <exclusive>false</exclusive>
> </divert>
> </diverts>
> {code}
> Artemis give me an error:
> {code}
> AMQ222006: Binding already exists with name foo-test, divert will not be
> deployed
> {code}
> Changing the divert names fixes the problem.
> Why can't I use the same name both for the queue and the divert feeding the
> queue?
> Since these are different kinds of objects, I should be able to reuse the
> same name, shouldn't I?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)