[ 
https://issues.apache.org/jira/browse/ARTEMIS-3365?focusedWorklogId=635024&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-635024
 ]

ASF GitHub Bot logged work on ARTEMIS-3365:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Aug/21 09:48
            Start Date: 06/Aug/21 09:48
    Worklog Time Spent: 10m 
      Work Description: gemmellr commented on pull request #3634:
URL: https://github.com/apache/activemq-artemis/pull/3634#issuecomment-894143709


   I dont think the keystore changes should using NO-JIRA in their log, at 
least some are being made directly for this JIRA so it makes sense for it to be 
reflected in the commit log.
   
   I think Clebert was looking to avoid creating the redirect handler objects 
entirely, which the updated version doesnt appear to. It still looks to affect 
every connection, but instead of with the throwaway handler, by adding a new 
field and creating the handler up front, then just possibly not using it. In 
some ways this is actually worse than previous version.
   
   I think there is a nicer route in-between, but nearer the earlier version 
2212d02f206bbdf9916db225e876eef4583c1326 [1], where it simply checks the 
redirect-to value on the connection first, and only then proceeds to create and 
use the handler if there was a need. E.g changes from the previous version for 
AMQP could maybe have been something like this instead (+add similar for other 
protocols):
   
   ```
   @@ -528,6 +528,5 @@ public class AMQPConnectionContext extends 
ProtonInitializable implements EventH
    
   -      AMQPRedirectHandler redirectHandler = new 
AMQPRedirectHandler(protocolManager.getServer(),
   -         connectionCallback, connection, handler.getSASLResult() != null ? 
handler.getSASLResult().getUser() : null);
   +      final boolean tryRedirect = 
connectionCallback.getTransportConnection().getRedirectTo() != null;
    
   -      if (redirectHandler.redirect() || !validateConnection(connection)) {
   +      if (tryRedirect && redirect(connection) || 
!validateConnection(connection)) {
             connection.close();
   @@ -557,2 +556,9 @@ public class AMQPConnectionContext extends 
ProtonInitializable implements EventH
    
   +   private final boolean redirect(Connection connection) throws Exception {
   +      AMQPRedirectHandler redirectHandler = new 
AMQPRedirectHandler(protocolManager.getServer(),
   +            connectionCallback, connection, handler.getSASLResult() != null 
? handler.getSASLResult().getUser() : null);
   +
   +      return redirectHandler.redirect();
   +   }
   +
       class ScheduleOperator implements UnaryOperator<Future<?>> {
   ```
   
   
   [1]  I still had the the 2212d02f206bbdf9916db225e876eef4583c1326 version 
locally, I put it at 
https://github.com/gemmellr/activemq-artemis/tree/balancer-pr3634-old1 in case 
you should want it.


-- 
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 635024)
    Time Spent: 9h 50m  (was: 9h 40m)

> Broker Balancers
> ----------------
>
>                 Key: ARTEMIS-3365
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3365
>             Project: ActiveMQ Artemis
>          Issue Type: New Feature
>            Reporter: Domenico Francesco Bruscino
>            Assignee: Domenico Francesco Bruscino
>            Priority: Major
>          Time Spent: 9h 50m
>  Remaining Estimate: 0h
>
> This feature adds the broker balancers to distribute the incoming client 
> connections across multiple brokers.
> It provides a native redirection for supported clients and a new management 
> API for other clients. The native redirection can be enabled per acceptor and 
> is supported only for CORE and AMQP clients.
> See the [draft 
> documentation|https://github.com/brusdev/activemq-artemis/blob/broker_balancers/docs/user-manual/en/broker-balancers.md]
>  for further details. 



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

Reply via email to