Java Code Examples for org.springframework.messaging.rsocket.RSocketRequester#Builder
The following examples show how to use
org.springframework.messaging.rsocket.RSocketRequester#Builder .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RSocketClientToSecuredServerITest.java From spring-rsocket-demo with GNU General Public License v3.0 | 6 votes |
@BeforeAll public static void setupOnce(@Autowired RSocketRequester.Builder builder, @LocalRSocketServerPort Integer port, @Autowired RSocketStrategies strategies) { SocketAcceptor responder = RSocketMessageHandler.responder(strategies, new ClientHandler()); mimeType = MimeTypeUtils.parseMimeType(WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION.getString()); // ******* The user 'test' is NOT in the required 'USER' role! ********** credentials = new UsernamePasswordMetadata("test", "pass"); requester = builder .setupRoute("shell-client") .setupData(UUID.randomUUID().toString()) .setupMetadata(credentials, mimeType) .rsocketStrategies(b -> b.encoder(new SimpleAuthenticationEncoder())) .rsocketConnector(connector -> connector.acceptor(responder)) .connectTcp("localhost", port) .block(); }
Example 2
Source File: RSocketClientToServerITest.java From spring-rsocket-demo with GNU General Public License v3.0 | 6 votes |
@BeforeAll public static void setupOnce(@Autowired RSocketRequester.Builder builder, @LocalRSocketServerPort Integer port, @Autowired RSocketStrategies strategies) { SocketAcceptor responder = RSocketMessageHandler.responder(strategies, new ClientHandler()); credentials = new UsernamePasswordMetadata("user", "pass"); mimeType = MimeTypeUtils.parseMimeType(WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION.getString()); requester = builder .setupRoute("shell-client") .setupData(UUID.randomUUID().toString()) .setupMetadata(credentials, mimeType) .rsocketStrategies(b -> b.encoder(new SimpleAuthenticationEncoder())) .rsocketConnector(connector -> connector.acceptor(responder)) .connectTcp("localhost", port) .block(); }
Example 3
Source File: RSocketClientDeniedConnectionToSecuredServerITest.java From spring-rsocket-demo with GNU General Public License v3.0 | 5 votes |
@BeforeAll public static void setupOnce(@Autowired RSocketRequester.Builder builder, @LocalRSocketServerPort Integer port, @Autowired RSocketStrategies strategies) { mimeType = MimeTypeUtils.parseMimeType(WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION.getString()); reqbuilder = builder; theport = port; // ******* The user 'fake' is NOT in the user list! ********** credentials = new UsernamePasswordMetadata("fake", "pass"); }
Example 4
Source File: BrokerClient.java From spring-cloud-rsocket with Apache License 2.0 | 5 votes |
public Mono<RSocketRequester> connect(RSocketRequester.Builder requesterBuilder) { Broker broker = properties.getBroker(); switch (broker.getConnectionType()) { case WEBSOCKET: return requesterBuilder.connectWebSocket(broker.getWsUri()); } return requesterBuilder.connectTcp(broker.getHost(), broker.getPort()); }
Example 5
Source File: GatewayRSocketClientAutoConfiguration.java From spring-cloud-rsocket with Apache License 2.0 | 5 votes |
@Bean @Scope("prototype") // TODO: I don't think prototype works here @ConditionalOnMissingBean public RSocketRequester.Builder gatewayRSocketRequesterBuilder( RSocketStrategies strategies, ClientProperties properties, MeterRegistry meterRegistry) { RouteSetup.Builder routeSetup = RouteSetup.of(properties.getRouteId(), properties.getServiceName()); properties.getTags().forEach((key, value) -> { if (key.getWellKnownKey() != null) { routeSetup.with(key.getWellKnownKey(), value); } else if (key.getCustomKey() != null) { routeSetup.with(key.getCustomKey(), value); } }); MicrometerRSocketInterceptor interceptor = new MicrometerRSocketInterceptor( meterRegistry, Tag.of("servicename", properties.getServiceName())); RSocketRequester.Builder builder = RSocketRequester.builder() .setupMetadata(routeSetup.build(), RouteSetup.ROUTE_SETUP_MIME_TYPE) .rsocketStrategies(strategies).rsocketFactory(configurer(interceptor)); return new ClientRSocketRequesterBuilder(builder, properties, strategies.routeMatcher()); }
Example 6
Source File: GatewayRSocketClientAutoConfiguration.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
@Bean public BrokerClient brokerClient(RSocketRequester.Builder builder, ClientProperties properties) { return new BrokerClient(properties, builder); }
Example 7
Source File: ClientRSocketRequesterBuilder.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
ClientRSocketRequesterBuilder(RSocketRequester.Builder delegate, ClientProperties properties, RouteMatcher routeMatcher) { this.delegate = delegate; this.properties = properties; this.routeMatcher = routeMatcher; }
Example 8
Source File: ClientRSocketRequesterBuilder.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
@Override public RSocketRequester.Builder dataMimeType(MimeType mimeType) { return delegate.dataMimeType(mimeType); }
Example 9
Source File: ClientRSocketRequesterBuilder.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
@Override public RSocketRequester.Builder metadataMimeType(MimeType mimeType) { return delegate.metadataMimeType(mimeType); }
Example 10
Source File: ClientRSocketRequesterBuilder.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
@Override public RSocketRequester.Builder setupData(Object data) { return delegate.setupData(data); }
Example 11
Source File: ClientRSocketRequesterBuilder.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
@Override public RSocketRequester.Builder setupRoute(String route, Object... routeVars) { return delegate.setupRoute(route, routeVars); }
Example 12
Source File: ClientRSocketRequesterBuilder.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
@Override public RSocketRequester.Builder setupMetadata(Object value, MimeType mimeType) { return delegate.setupMetadata(value, mimeType); }
Example 13
Source File: ClientRSocketRequesterBuilder.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
@Override public RSocketRequester.Builder rsocketStrategies(RSocketStrategies strategies) { return delegate.rsocketStrategies(strategies); }
Example 14
Source File: ClientRSocketRequesterBuilder.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
@Override public RSocketRequester.Builder rsocketStrategies( Consumer<RSocketStrategies.Builder> configurer) { return delegate.rsocketStrategies(configurer); }
Example 15
Source File: ClientRSocketRequesterBuilder.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
@Override public RSocketRequester.Builder rsocketFactory( ClientRSocketFactoryConfigurer configurer) { return delegate.rsocketFactory(configurer); }
Example 16
Source File: ClientRSocketRequesterBuilder.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
@Override public RSocketRequester.Builder apply(Consumer<RSocketRequester.Builder> configurer) { return delegate.apply(configurer); }
Example 17
Source File: BrokerClient.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
public BrokerClient(ClientProperties properties, RSocketRequester.Builder builder) { this.properties = properties; this.builder = builder; }
Example 18
Source File: BrokerClient.java From spring-cloud-rsocket with Apache License 2.0 | 4 votes |
public RSocketRequester.Builder getRSocketRequesterBuilder() { return this.builder; }
Example 19
Source File: RSocketShellClient.java From spring-rsocket-demo with GNU General Public License v3.0 | 4 votes |
@Autowired public RSocketShellClient(RSocketRequester.Builder builder, @Qualifier("rSocketStrategies") RSocketStrategies strategies) { this.rsocketRequesterBuilder = builder; this.rsocketStrategies = strategies; }