You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by "mattrpav (via GitHub)" <gi...@apache.org> on 2026/09/22 19:49:05 UTC

[PR] [#2602] defer prefetch until connection is started [activemq]

mattrpav opened a new pull request, #2605:
URL: https://github.com/apache/activemq/pull/2605

   (no comment)


-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] [#2602] defer prefetch until connection is started [activemq]

Posted by "cshannon (via GitHub) via gitbox" <gi...@activemq.apache.org>.
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] [#2602] defer prefetch until connection is started [activemq]

Posted by "mattrpav (via GitHub) via gitbox" <gi...@activemq.apache.org>.
mattrpav commented on PR #2605:
URL: https://github.com/apache/activemq/pull/2605#issuecomment-6688936805

   @jeanouii @cshannon I believe this change could go into a 6.5.x, as the new flag defaults to existing behavior. In 7.x, we could consider making deferring prefetch the default (probably better).
   
   The use case is 2 connections on the same queue, one is started, the other isn't. The started connection should get all the messages. Currently, prefetch happens for all connections, regardless if they have been started.


-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact