use of io.scalecube.services.sut.SimpleQuoteService in project scalecube by scalecube.
the class ServiceCallRemoteTest method test_service_address_lookup_occur_only_after_subscription.
@Test
public void test_service_address_lookup_occur_only_after_subscription() {
Flux<ServiceMessage> quotes = gateway.call().requestMany(ServiceMessage.builder().qualifier(QuoteService.NAME, "onlyOneAndThenNever").data(null).build());
// Add service to cluster AFTER creating a call object.
// (prove address lookup occur only after subscription)
Microservices quotesService = serviceProvider(new SimpleQuoteService());
StepVerifier.create(quotes.take(1)).expectNextCount(1).expectComplete().verify(TIMEOUT);
try {
quotesService.shutdown();
} catch (Exception ignored) {
// no-op
}
}
use of io.scalecube.services.sut.SimpleQuoteService in project scalecube by scalecube.
the class StreamingServiceTest method setup.
@BeforeAll
public static void setup() {
gateway = Microservices.builder().discovery(serviceEndpoint -> new ScalecubeServiceDiscovery().transport(cfg -> cfg.transportFactory(new WebsocketTransportFactory())).options(opts -> opts.metadata(serviceEndpoint))).transport(RSocketServiceTransport::new).defaultDataDecoder(ServiceMessageCodec::decodeData).startAwait();
final Address gatewayAddress = gateway.discovery().address();
node = Microservices.builder().discovery(endpoint -> new ScalecubeServiceDiscovery().transport(cfg -> cfg.transportFactory(new WebsocketTransportFactory())).options(opts -> opts.metadata(endpoint)).membership(cfg -> cfg.seedMembers(gatewayAddress))).transport(RSocketServiceTransport::new).defaultDataDecoder(ServiceMessageCodec::decodeData).services(new SimpleQuoteService()).startAwait();
}
use of io.scalecube.services.sut.SimpleQuoteService in project scalecube by scalecube.
the class RSocketServiceTransportTest method setUp.
@BeforeEach
public void setUp() {
gateway = Microservices.builder().discovery(endpoint -> new ScalecubeServiceDiscovery().transport(cfg -> cfg.transportFactory(new WebsocketTransportFactory())).options(opts -> opts.metadata(endpoint))).transport(RSocketServiceTransport::new).startAwait();
final Address gatewayAddress = this.gateway.discovery().address();
serviceNode = Microservices.builder().discovery(serviceEndpoint -> new ScalecubeServiceDiscovery().transport(cfg -> cfg.transportFactory(new WebsocketTransportFactory())).options(opts -> opts.metadata(serviceEndpoint)).membership(cfg -> cfg.seedMembers(gatewayAddress))).transport(RSocketServiceTransport::new).services(new SimpleQuoteService()).startAwait();
}
Aggregations