[ 
https://issues.apache.org/jira/browse/ARTEMIS-1937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16629029#comment-16629029
 ] 

Justin Bertram commented on ARTEMIS-1937:
-----------------------------------------

The nuance here is that each protocol implementation on the broker (e.g. STOMP, 
AMQP, MQTT) is responsible for creating addresses & queues which don't exist, 
but the core protocol itself never auto-creates addresses or queues.  When the 
message is routed to the divert the divert has no idea about the originating 
protocol, and it doesn't perform any auto-creation on its own.  It's possible 
the semantics here could be changed but it will take some careful thought and 
potentially some significant refactoring.

> 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
(v7.6.3#76005)

Reply via email to