You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2021/09/23 21:08:00 UTC

[jira] [Resolved] (ARTEMIS-1937) Diverts do not work with auto created queues

     [ https://issues.apache.org/jira/browse/ARTEMIS-1937?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Bertram resolved ARTEMIS-1937.
-------------------------------------
    Resolution: Not A Bug

> Diverts do not work with auto created queues
> --------------------------------------------
>
>                 Key: ARTEMIS-1937
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1937
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Lionel Cons
>            Priority: Major
>
> Consider the following configuration snippet:
> {code}
>   <address-settings>
>     <address-setting match="/queue/test.#">
>       <default-address-routing-type>ANYCAST</default-address-routing-type>
>       <default-queue-routing-type>ANYCAST</default-queue-routing-type>
>     </address-setting>
>     <address-setting match="/topic/test.#">
>       <default-address-routing-type>MULTICAST</default-address-routing-type>
>       <default-queue-routing-type>MULTICAST</default-queue-routing-type>
>     </address-setting>
>     ...
>   </address-settings>
>   
>   <diverts>
>     <divert name="vq-foo-aaa">
>       <address>/topic/test.foo</address>
>       <forwarding-address>/queue/test.vq.aaa.foo</forwarding-address>
>       <exclusive>false</exclusive>
>     </divert>
>     <divert name="vq-foo-bbb">
>       <address>/topic/test.foo</address>
>       <forwarding-address>/queue/test.vq.bbb.foo</forwarding-address>
>       <exclusive>false</exclusive>
>     </divert>
>     ...
>   </diverts>
> {code}
> The goal of the {{<address-settings>}} part is to make sure that STOMP destinations like {{/queue/test.\*}} act like a queue and the ones like {{/topic/test.\*}} act like a topic. It works fine and sending a message to a non existing destination works as expected.
> The goal of the {{<diverts>}} part is to emulate ActiveMQ 5 virtual destinations. A message sent to {{/topic/test.foo}} will get duplicated and will end up both in {{/queue/test.vq.aaa.foo}} and in {{/queue/test.vq.bbb.foo}}.
> The problem is that the configuration above does not work as a message being sent to {{/topic/test.foo}} is lost if the final queue does not exist. OTOH, a message directly sent to {{/queue/test.vq.aaa.foo}} will auto create the queue and will be kept.
> Adding the following:
> {code}
>   <addresses>
>     <address name="/queue/test.vq.aaa.foo">
>       <anycast>
>         <queue name="/queue/test.vq.aaa.foo"/>
>       </anycast>
>     </address>
>     <address name="/queue/test.vq.bbb.foo">
>       <anycast>
>         <queue name="/queue/test.vq.bbb.foo"/>
>       </anycast>
>     </address>
>     ...
>   <addresses>
> {code}
> makes Artemis work as expected but this voids the use of the {{<address-settings>}} part.
> IMHO, a message sent to a divert pointing to an address (whether it already exists or not) should have the exact same behavior as a message sent directly to the forwarding address.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)