Search in sources :

Example 1 with LoadbalanceRSocketClient

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);
}
Also used : RSocketConnector(io.rsocket.core.RSocketConnector) LoadbalanceRSocketClient(io.rsocket.loadbalance.LoadbalanceRSocketClient) MimeType(org.springframework.util.MimeType) WellKnownMimeType(io.rsocket.metadata.WellKnownMimeType)

Aggregations

RSocketConnector (io.rsocket.core.RSocketConnector)1 LoadbalanceRSocketClient (io.rsocket.loadbalance.LoadbalanceRSocketClient)1 WellKnownMimeType (io.rsocket.metadata.WellKnownMimeType)1 MimeType (org.springframework.util.MimeType)1