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

Justin Bertram commented on ARTEMIS-4472:
-----------------------------------------

FWIW, I believe this is functioning as designed. A divert is a "binding" on an 
address just like a queue is. However, the configured {{address-full-policy}} 
is enforced at the _address_ level. Therefore, when the address is full and the 
{{address-full-policy}} is {{BLOCK}} this means that the message is never 
actually routed to any of the bindings on the address so the divert doesn't get 
the message.

I think changing this would be pretty tricky as it would require the broker to 
"look ahead" at the bindings and route messages selectively. This would almost 
certainly negatively impact performance. It may be best to simply update the 
documentation to clarify that the address-full-policy of the address to which 
the message is sent is the policy that will be enforced regardless of divert 
configuration.

> Diverts block when target address is not blocked
> ------------------------------------------------
>
>                 Key: ARTEMIS-4472
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4472
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.31.0
>            Reporter: Josh Reagan
>            Priority: Minor
>
> When using an exclusive divert with an {{address-full-policy}} set to 
> {{BLOCK}}, the divert will become blocked when the source address reaches its 
> limit. This happens even if the target address has space and is not blocked. 
> For instance, if I have an address {{app.source-addr}}, and a divert picking 
> up select messages from that source address and routing them to 
> {{app.target-addr}}. If the address {{app.source-addr}} becomes full and 
> blocks, producers are no longer able to send messages. Even though the 
> messages they sent would be routed to the {{app.target-addr}}, and that 
> address still has space available.
> Sample config:
> {code:xml}
> <address-settings>
>   <address-setting match="app.source-addr">
>     <max-size-messages>5</max-size-messages>
>     <address-full-policy>BLOCK</address-full-policy>
>   </address-setting>
> </address-settings>
> <addresses>
>   <address name="app.source-addr">
>     <anycast/>
>   </address>
> </addresses>
> <diverts>
>   <divert name="divert-app.source-addr">
>     <address>app.source-addr</address>
>     <forwarding-address>app.target-addr</forwarding-address>
>     <exclusive>true</exclusive>
>   </divert>
> </diverts>
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to