Source:
ReactorSender(String entityPath, Sender sender, SendLinkHandler handler, ReactorProvider reactorProvider, TokenManager tokenManager, MessageSerializer messageSerializer, Duration timeout, AmqpRetryPolicy retry) { this.entityPath = entityPath; this.sender = sender; this.handler = handler; this.reactorProvider = reactorProvider; this.tokenManager = tokenManager; this.messageSerializer = messageSerializer; this.retry = retry; this.timeout = timeout; this.subscriptions = Disposables.composite( this.handler.getDeliveredMessages().subscribe(this::processDeliveredMessage), this.handler.getLinkCredits().subscribe(credit -> { logger.verbose("Credits on link: {}", credit); this.scheduleWorkOnDispatcher(); }), this.handler.getEndpointStates().subscribe( state -> { logger.verbose("[{}] Connection state: {}", entityPath, state); this.hasConnected.set(state == EndpointState.ACTIVE); endpointStateSink.next(AmqpEndpointStateUtil.getConnectionState(state)); }, error -> { logger.error("[{}] Error occurred in sender endpoint handler.", entityPath, error); endpointStateSink.error(error); }, () -> { endpointStateSink.next(AmqpEndpointState.CLOSED); endpointStateSink.complete(); hasConnected.set(false); }), this.handler.getErrors().subscribe(error -> { logger.error("[{}] Error occurred in sender error handler.", entityPath, error); endpointStateSink.error(error); }), () -> { if (tokenManager != null) { this.tokenManager.getAuthorizationResults().subscribe( response -> { logger.verbose("Token refreshed: {}", response); hasAuthorized.set(true); }, error -> { logger.info("clientId[{}], path[{}], linkName[{}] - tokenRenewalFailure[{}]", handler.getConnectionId(), this.entityPath, getLinkName(), error.getMessage()); hasAuthorized.set(false); }, () -> hasAuthorized.set(false)); } } ); }

Target:
ReactorSender(String entityPath, Sender sender, SendLinkHandler handler, ReactorProvider reactorProvider, TokenManager tokenManager, MessageSerializer messageSerializer, Duration timeout, AmqpRetryPolicy retry) { this.entityPath = entityPath; this.sender = sender; this.handler = handler; this.reactorProvider = reactorProvider; this.tokenManager = tokenManager; this.messageSerializer = messageSerializer; this.retry = retry; this.timeout = timeout; this.subscriptions = Disposables.composite( this.handler.getDeliveredMessages().subscribe(this::processDeliveredMessage), this.handler.getLinkCredits().subscribe(credit -> { logger.verbose("Credits on link: {}", credit); this.scheduleWorkOnDispatcher(); }), this.handler.getEndpointStates().subscribe( state -> { logger.verbose("[{}] Connection state: {}", entityPath, state); this.hasConnected.set(state == EndpointState.ACTIVE); endpointStateSink.next(AmqpEndpointStateUtil.getConnectionState(state)); }, error -> { logger.error("[{}] Error occurred in sender endpoint handler.", entityPath, error); endpointStateSink.error(error); }, () -> { endpointStateSink.next(AmqpEndpointState.CLOSED); endpointStateSink.complete(); hasConnected.set(false); }), this.handler.getErrors().subscribe(error -> { logger.error("[{}] Error occurred in sender error handler.", entityPath, error); endpointStateSink.error(error); }) ); if (tokenManager != null) { this.subscriptions.add(this.tokenManager.getAuthorizationResults().subscribe( response -> { logger.verbose("Token refreshed: {}", response); hasAuthorized.set(true); }, error -> { logger.info("clientId[{}], path[{}], linkName[{}] - tokenRenewalFailure[{}]", handler.getConnectionId(), this.entityPath, getLinkName(), error.getMessage()); hasAuthorized.set(false); }, () -> hasAuthorized.set(false))); } }