[
https://issues.apache.org/jira/browse/ARTEMIS-4473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17780068#comment-17780068
]
Justin Bertram commented on ARTEMIS-4473:
-----------------------------------------
I believe this is working as designed. As explained on ARTEMIS-4472, the divert
is a binding on the address. If flow control is not being enforced on the
original address and the message is routed to the divert then there's really
nowhere else for the message to go except to wherever the divert is forwarding
it. The divert can't just hold it. If the message is durable and the broker
crashes then the message will be lost. Also at that point the message is
already consuming heap space so it might as well just be put on the queue since
nothing is really being saved.
It's worth noting that the goal of the {{BLOCK}} {{address-full-policy}} is to
prevent the message from getting to the broker in the first place by blocking
the remote client from actually sending it. Once the message makes it to the
broker it doesn't make sense to block it.
As with ARTEMIS-4472 I think this is something that just be clarified in the
documentation.
> Diverts do not block when target address is full
> ------------------------------------------------
>
> Key: ARTEMIS-4473
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4473
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: Broker
> Affects Versions: 2.31.0
> Reporter: Josh Reagan
> Priority: Minor
>
> When a message arrives on a source address, and is diverted to a target
> address, the message will be routed to the target address even if that target
> address is full and its address-full-policy is set to {{BLOCK}}. So if I have
> an address {{app.source-addr}} which has space available. I can send messages
> to it without issue. If that address has a divert configured to route the
> messages to {{app.target-addr}}, they will be routed to that target address
> without issue. Even if {{app.target-addr}} is full and is blocked.
> Sample config:
> {code:xml}
> <address-settings>
> <address-setting match="app.target-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)