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

Anton Roskvist commented on ARTEMIS-1925:
-----------------------------------------

[~gtully]  I have looked further into this and I have tried to make some small 
changes. By removing the "OFF_WITH_DISTRIBUTION" condition on 
RemoteQueueBinding I can get close to what I think the intended behavior is, 
but two issues remain. One small and one potentially nasty one.

The small issue is that if a queue with a consumer exists on node A but not on 
B, and B suddenly gets messages and the queue gets auto created, then 
redistribution is not started. Messages pile up on node B. If the consumer 
detaches and reattaches redistribution happens. I saw this issue with a 
previous attempt at achieving the same functionality in the broker 
(redistribution but no initial distribution) and it seems to be because a 
redistributor is only added when a consumer is created AND you have a local 
binding for that queue.

The bigger issue might be related and comes from Multicast/topics in a similar 
scenario. As it is now (with your change and also the changes I've made), if a 
publisher and subscriber for the same topic are on different nodes, all 
messages are silently dropped (for non-durable messages).

These are the changes I've made: 
[https://github.com/AntonRoskvist/activemq-artemis/commit/eddfd5aae29b3746167ffbdf877cde2a3fa25227]

Please note that while it does work for the smaller issue it does not do 
anything for the topics. Also the change in postoffice should probably be 
conditional (only add redistributor if some other node in the cluster has a 
consumer) but I have yet to figure out how to poll for binding info on 
clustered nodes.

Hope any of this is helpful. I will keep looking into it but I have pretty 
limited coding experience...

Br,

Anton

> Allow message redistribution even with OFF message-load-balancing semantics
> ---------------------------------------------------------------------------
>
>                 Key: ARTEMIS-1925
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1925
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Justin Bertram
>            Assignee: Gary Tully
>            Priority: Major
>             Fix For: 2.20.0
>
>          Time Spent: 10h 10m
>  Remaining Estimate: 0h
>
> Currently if the {{message-load-balancing}} is {{STRICT}} or {{OFF}} then 
> message redistribution is disabled.  Message redistribution should be 
> controlled only by the {{redistribtion-delay}}.



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

Reply via email to