cshannon commented on PR #2605:
URL: https://github.com/apache/activemq/pull/2605#issuecomment-6952692480

   This approach works but it feels a little "hacky" for the lack of a better 
term because it feels like we are using prefetch in a way it was never 
intended.  It also may be the solution we need to go with, I just want to lay 
out an alternative.
   
   Dynamically setting prefetch is a great feature but it was not intended to 
signal connection started. This change is trying to use setting the prefetch as 
0 as a way to work around the real problem where the broker is dispatching to 
consumers that exist on connections where start was never called.
   
   I think an alternate approach could be a bit cleaner/better and simpler to 
understand going forward. What is the real issue here? The core problem is the 
client is not telling the broker it called start...so we should just do that. 
We would need to generate a new OpenWire version though, which is the main 
issue. The ConnectionControl command could have a new start flag added to it 
and that could be set to true an sent when start is called. I suppose we could 
add a matching stop as well but may not be needed.
   
   On the broker side, the broker can receive that and honor it. The broker can 
simply mark consumers as inactive for dispatch until the connection control is 
received and skip sending. I think we probably even want to prevent dispatching 
for a pull but not sure.  There of course is the issue of backwards 
compatibility. I think we could just add a policy setting for destinations that 
is something like `requireConnectionStartForDispatch` or whatever you want to 
rename it. The broker would only dispatch in that case.  For backwards 
compatibility we could keep it as false for 6.x and make it true for 7.x.
   
   Ok, so all that being said, the problem is the openwire version. So we need 
to decide if we want to do that or not. One option is to go with this approach 
for now until we generate a new version of openwire. The problem is once you 
add new flags to the public API on the client then it's really hard to remove.  
   
   So I think our two choices are:
   
   1. Go with this approach
   2. Look at adding a new flag to ConnectionControl (so defer until we 
generate a new OpenWire version)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to