use of io.rsocket.loadbalance.LoadbalanceRSocketClient in project spring-framework by spring-projects.
the class DefaultRSocketRequesterBuilder method transports.
@Override
public RSocketRequester transports(Publisher<List<LoadbalanceTarget>> targetPublisher, LoadbalanceStrategy loadbalanceStrategy) {
RSocketStrategies strategies = getRSocketStrategies();
MimeType metaMimeType = getMetadataMimeType();
MimeType dataMimeType = getDataMimeType(strategies);
RSocketConnector connector = initConnector(this.rsocketConnectorConfigurers, metaMimeType, dataMimeType, strategies);
LoadbalanceRSocketClient client = LoadbalanceRSocketClient.builder(targetPublisher).connector(connector).loadbalanceStrategy(loadbalanceStrategy).build();
return new DefaultRSocketRequester(client, null, dataMimeType, metaMimeType, strategies);
}
Aggregations