Search in sources :

Example 1 with Address

use of io.scalecube.net.Address in project scalecube by scalecube.

the class ServiceRegistryTest method test_listen_to_discovery_events.

@ParameterizedTest
@MethodSource("metadataCodecSource")
public void test_listen_to_discovery_events(MetadataCodec metadataCodec) {
    Sinks.Many<ServiceDiscoveryEvent> processor = Sinks.many().replay().all();
    List<Microservices> cluster = new CopyOnWriteArrayList<>();
    Microservices seed = Microservices.builder().discovery(defServiceDiscovery(metadataCodec)).transport(RSocketServiceTransport::new).services(new AnnotationServiceImpl()).startAwait();
    cluster.add(seed);
    seed.listenDiscovery().subscribe(processor::tryEmitNext, processor::tryEmitError, processor::tryEmitComplete);
    Address seedAddress = seed.discovery().address();
    StepVerifier.create(processor.asFlux().onBackpressureBuffer()).then(() -> {
        Microservices ms1 = Microservices.builder().discovery(defServiceDiscovery(seedAddress, metadataCodec)).transport(RSocketServiceTransport::new).services(new GreetingServiceImpl()).startAwait();
        cluster.add(ms1);
    }).assertNext(event -> assertEquals(ENDPOINT_ADDED, event.type())).then(() -> {
        Microservices ms2 = Microservices.builder().discovery(defServiceDiscovery(seedAddress, metadataCodec)).transport(RSocketServiceTransport::new).services(new GreetingServiceImpl()).startAwait();
        cluster.add(ms2);
    }).assertNext(event -> assertEquals(ENDPOINT_ADDED, event.type())).then(() -> cluster.remove(2).shutdown().block(TIMEOUT)).assertNext(event -> assertEquals(ENDPOINT_LEAVING, event.type())).assertNext(event -> assertEquals(ENDPOINT_REMOVED, event.type())).then(() -> cluster.remove(1).shutdown().block(TIMEOUT)).assertNext(event -> assertEquals(ENDPOINT_LEAVING, event.type())).assertNext(event -> assertEquals(ENDPOINT_REMOVED, event.type())).thenCancel().verify(TIMEOUT);
    StepVerifier.create(seed.call().api(AnnotationService.class).serviceDiscoveryEventTypes()).assertNext(type -> assertEquals(ENDPOINT_ADDED, type)).assertNext(type -> assertEquals(ENDPOINT_ADDED, type)).assertNext(type -> assertEquals(ENDPOINT_LEAVING, type)).assertNext(type -> assertEquals(ENDPOINT_REMOVED, type)).assertNext(type -> assertEquals(ENDPOINT_LEAVING, type)).assertNext(type -> assertEquals(ENDPOINT_REMOVED, type)).thenCancel().verify(TIMEOUT);
    Mono.whenDelayError(cluster.stream().map(Microservices::shutdown).toArray(Mono[]::new)).block(TIMEOUT);
}
Also used : Sinks(reactor.core.publisher.Sinks) ENDPOINT_LEAVING(io.scalecube.services.discovery.api.ServiceDiscoveryEvent.Type.ENDPOINT_LEAVING) StepVerifier(reactor.test.StepVerifier) MetadataCodec(io.scalecube.cluster.metadata.MetadataCodec) JdkMetadataCodec(io.scalecube.cluster.metadata.JdkMetadataCodec) ENDPOINT_ADDED(io.scalecube.services.discovery.api.ServiceDiscoveryEvent.Type.ENDPOINT_ADDED) Duration(java.time.Duration) ServiceDiscoveryEvent(io.scalecube.services.discovery.api.ServiceDiscoveryEvent) WebsocketTransportFactory(io.scalecube.transport.netty.websocket.WebsocketTransportFactory) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Address(io.scalecube.net.Address) MethodSource(org.junit.jupiter.params.provider.MethodSource) ScalecubeServiceDiscovery(io.scalecube.services.discovery.ScalecubeServiceDiscovery) ENDPOINT_REMOVED(io.scalecube.services.discovery.api.ServiceDiscoveryEvent.Type.ENDPOINT_REMOVED) JacksonMetadataCodec(io.scalecube.cluster.codec.jackson.JacksonMetadataCodec) Mono(reactor.core.publisher.Mono) Arguments(org.junit.jupiter.params.provider.Arguments) AnnotationService(io.scalecube.services.sut.AnnotationService) AnnotationServiceImpl(io.scalecube.services.sut.AnnotationServiceImpl) RSocketServiceTransport(io.scalecube.services.transport.rsocket.RSocketServiceTransport) List(java.util.List) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Stream(java.util.stream.Stream) ServiceDiscoveryFactory(io.scalecube.services.discovery.api.ServiceDiscoveryFactory) GreetingServiceImpl(io.scalecube.services.sut.GreetingServiceImpl) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Sinks(reactor.core.publisher.Sinks) Address(io.scalecube.net.Address) ServiceDiscoveryEvent(io.scalecube.services.discovery.api.ServiceDiscoveryEvent) AnnotationServiceImpl(io.scalecube.services.sut.AnnotationServiceImpl) GreetingServiceImpl(io.scalecube.services.sut.GreetingServiceImpl) RSocketServiceTransport(io.scalecube.services.transport.rsocket.RSocketServiceTransport) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 2 with Address

use of io.scalecube.net.Address in project scalecube by scalecube.

the class RoutersTest 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).startAwait();
    gatewayAddress = gateway.discovery().address();
    // Create microservices instance cluster.
    provider1 = 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).services(ServiceInfo.fromServiceInstance(new GreetingServiceImpl(1)).tag("ONLYFOR", "joe").tag("SENDER", "1").build(), ServiceInfo.fromServiceInstance(new GreetingServiceImplA()).tag("Weight", "0.1").build()).startAwait();
    // Create microservices instance cluster.
    provider2 = 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).services(ServiceInfo.fromServiceInstance(new GreetingServiceImpl(2)).tag("ONLYFOR", "fransin").tag("SENDER", "2").build(), ServiceInfo.fromServiceInstance(new GreetingServiceImplB()).tag("Weight", "0.9").build()).startAwait();
    TagService tagService = input -> input.map(String::toUpperCase);
    provider3 = 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).services(ServiceInfo.fromServiceInstance(tagService).tag("tagB", "bb").tag("tagC", "c").build()).startAwait();
}
Also used : Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) GreetingServiceImplB(io.scalecube.services.routings.sut.GreetingServiceImplB) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) GreetingServiceImplA(io.scalecube.services.routings.sut.GreetingServiceImplA) DummyRouter(io.scalecube.services.routings.sut.DummyRouter) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) GreetingResponse(io.scalecube.services.sut.GreetingResponse) HashSet(java.util.HashSet) AfterAll(org.junit.jupiter.api.AfterAll) RandomServiceRouter(io.scalecube.services.routing.RandomServiceRouter) GREETING_REQUEST_REQ2(io.scalecube.services.TestRequests.GREETING_REQUEST_REQ2) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) BeforeAll(org.junit.jupiter.api.BeforeAll) Arrays.asList(java.util.Arrays.asList) ServiceCall(io.scalecube.services.ServiceCall) Duration(java.time.Duration) Map(java.util.Map) WebsocketTransportFactory(io.scalecube.transport.netty.websocket.WebsocketTransportFactory) GreetingRequest(io.scalecube.services.sut.GreetingRequest) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Address(io.scalecube.net.Address) ServiceReference(io.scalecube.services.ServiceReference) ScalecubeServiceDiscovery(io.scalecube.services.discovery.ScalecubeServiceDiscovery) CanaryService(io.scalecube.services.routings.sut.CanaryService) ServiceInfo(io.scalecube.services.ServiceInfo) Mono(reactor.core.publisher.Mono) TagService(io.scalecube.services.routings.sut.TagService) RSocketServiceTransport(io.scalecube.services.transport.rsocket.RSocketServiceTransport) TimeUnit(java.util.concurrent.TimeUnit) Test(org.junit.jupiter.api.Test) Routers(io.scalecube.services.routing.Routers) Flux(reactor.core.publisher.Flux) Microservices(io.scalecube.services.Microservices) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Reflect(io.scalecube.services.Reflect) GREETING_REQUEST_REQ(io.scalecube.services.TestRequests.GREETING_REQUEST_REQ) GreetingServiceImpl(io.scalecube.services.sut.GreetingServiceImpl) Optional(java.util.Optional) ServiceMessage(io.scalecube.services.api.ServiceMessage) BaseTest(io.scalecube.services.BaseTest) WeightedRandomRouter(io.scalecube.services.routings.sut.WeightedRandomRouter) ScalecubeServiceDiscovery(io.scalecube.services.discovery.ScalecubeServiceDiscovery) WebsocketTransportFactory(io.scalecube.transport.netty.websocket.WebsocketTransportFactory) TagService(io.scalecube.services.routings.sut.TagService) GreetingServiceImpl(io.scalecube.services.sut.GreetingServiceImpl) RSocketServiceTransport(io.scalecube.services.transport.rsocket.RSocketServiceTransport) GreetingServiceImplA(io.scalecube.services.routings.sut.GreetingServiceImplA) GreetingServiceImplB(io.scalecube.services.routings.sut.GreetingServiceImplB) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 3 with Address

use of io.scalecube.net.Address in project scalecube by scalecube.

the class Microservices method newServiceEndpoint.

private ServiceEndpoint newServiceEndpoint(ServiceEndpoint serviceEndpoint) {
    ServiceEndpoint.Builder builder = ServiceEndpoint.from(serviceEndpoint);
    int port = Optional.ofNullable(externalPort).orElse(serviceEndpoint.address().port());
    // calculate local service endpoint address
    Address newAddress = Optional.ofNullable(externalHost).map(host -> Address.create(host, port)).orElseGet(() -> Address.create(serviceEndpoint.address().host(), port));
    return builder.address(newAddress).build();
}
Also used : ServiceDiscoveryOptions(io.scalecube.services.discovery.api.ServiceDiscoveryOptions) Sinks(reactor.core.publisher.Sinks) Arrays(java.util.Arrays) ServiceProviderErrorMapper(io.scalecube.services.exceptions.ServiceProviderErrorMapper) LoggerFactory(org.slf4j.LoggerFactory) UnaryOperator(java.util.function.UnaryOperator) ClientTransport(io.scalecube.services.transport.api.ClientTransport) DefaultErrorMapper(io.scalecube.services.exceptions.DefaultErrorMapper) InetAddress(java.net.InetAddress) Map(java.util.Map) ServiceTransport(io.scalecube.services.transport.api.ServiceTransport) Disposables(reactor.core.Disposables) Address(io.scalecube.net.Address) GatewayOptions(io.scalecube.services.gateway.GatewayOptions) ServiceDiscoveryContext(io.scalecube.services.discovery.api.ServiceDiscoveryContext) ServerTransport(io.scalecube.services.transport.api.ServerTransport) ServiceRegistry(io.scalecube.services.registry.api.ServiceRegistry) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) UUID(java.util.UUID) ObjectName(javax.management.ObjectName) Collectors(java.util.stream.Collectors) ServiceDiscovery(io.scalecube.services.discovery.api.ServiceDiscovery) RoundRobinServiceRouter(io.scalecube.services.routing.RoundRobinServiceRouter) Objects(java.util.Objects) Routers(io.scalecube.services.routing.Routers) List(java.util.List) DataCodec(io.scalecube.services.transport.api.DataCodec) ServiceMethodInvoker(io.scalecube.services.methods.ServiceMethodInvoker) ServiceDiscoveryFactory(io.scalecube.services.discovery.api.ServiceDiscoveryFactory) Optional(java.util.Optional) ServiceMessage(io.scalecube.services.api.ServiceMessage) Exceptions(reactor.core.Exceptions) StandardMBean(javax.management.StandardMBean) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Disposable(reactor.core.Disposable) ServiceMethodRegistryImpl(io.scalecube.services.methods.ServiceMethodRegistryImpl) MethodInfo(io.scalecube.services.methods.MethodInfo) HashMap(java.util.HashMap) Scheduler(reactor.core.scheduler.Scheduler) Function(java.util.function.Function) Supplier(java.util.function.Supplier) Authenticator(io.scalecube.services.auth.Authenticator) ArrayList(java.util.ArrayList) ServiceMessageDataDecoder(io.scalecube.services.transport.api.ServiceMessageDataDecoder) MBeanServer(javax.management.MBeanServer) ServiceDiscoveryEvent(io.scalecube.services.discovery.api.ServiceDiscoveryEvent) ServiceRegistryImpl(io.scalecube.services.registry.ServiceRegistryImpl) Schedulers(reactor.core.scheduler.Schedulers) ManagementFactory(java.lang.management.ManagementFactory) NoSuchElementException(java.util.NoSuchElementException) Logger(org.slf4j.Logger) RETRY_NON_SERIALIZED(io.scalecube.reactor.RetryNonSerializedEmitFailureHandler.RETRY_NON_SERIALIZED) Mono(reactor.core.publisher.Mono) UnknownHostException(java.net.UnknownHostException) PrincipalMapper(io.scalecube.services.auth.PrincipalMapper) Flux(reactor.core.publisher.Flux) Gateway(io.scalecube.services.gateway.Gateway) StringJoiner(java.util.StringJoiner) Type(io.scalecube.services.discovery.api.ServiceDiscoveryEvent.Type) Collections(java.util.Collections) ServiceMethodRegistry(io.scalecube.services.methods.ServiceMethodRegistry) InetAddress(java.net.InetAddress) Address(io.scalecube.net.Address)

Example 4 with Address

use of io.scalecube.net.Address in project scalecube by scalecube.

the class Microservices method start.

private Mono<Microservices> start() {
    LOGGER.info("[{}][start] Starting", id);
    // Create bootstrap scheduler
    Scheduler scheduler = Schedulers.newSingle(toString(), true);
    return transportBootstrap.start(this).publishOn(scheduler).flatMap(transportBootstrap -> {
        final ServiceCall call = call();
        final Address serviceAddress = transportBootstrap.transportAddress;
        final ServiceEndpoint.Builder serviceEndpointBuilder = ServiceEndpoint.builder().id(id).address(serviceAddress).contentTypes(DataCodec.getAllContentTypes()).tags(tags);
        // invoke service providers and register services
        List<Object> serviceInstances = serviceProviders.stream().flatMap(serviceProvider -> serviceProvider.provide(call).stream()).peek(this::registerInMethodRegistry).peek(serviceInfo -> serviceEndpointBuilder.appendServiceRegistrations(ServiceScanner.scanServiceInfo(serviceInfo))).map(ServiceInfo::serviceInstance).collect(Collectors.toList());
        if (transportBootstrap == ServiceTransportBootstrap.NULL_INSTANCE && !serviceInstances.isEmpty()) {
            LOGGER.warn("[{}] ServiceTransport is not set", this.id());
        }
        serviceEndpoint = newServiceEndpoint(serviceEndpointBuilder.build());
        return createDiscovery(this, new ServiceDiscoveryOptions().serviceEndpoint(serviceEndpoint)).publishOn(scheduler).then(startGateway(new GatewayOptions().call(call))).publishOn(scheduler).then(Mono.fromCallable(() -> Injector.inject(this, serviceInstances))).then(Mono.fromCallable(() -> JmxMonitorMBean.start(this))).then(compositeDiscovery.startListen()).publishOn(scheduler).thenReturn(this);
    }).onErrorResume(ex -> Mono.defer(this::shutdown).then(Mono.error(ex)).cast(Microservices.class)).doOnSuccess(m -> LOGGER.info("[{}][start] Started", id)).doOnTerminate(scheduler::dispose);
}
Also used : ServiceDiscoveryOptions(io.scalecube.services.discovery.api.ServiceDiscoveryOptions) Sinks(reactor.core.publisher.Sinks) Arrays(java.util.Arrays) ServiceProviderErrorMapper(io.scalecube.services.exceptions.ServiceProviderErrorMapper) LoggerFactory(org.slf4j.LoggerFactory) UnaryOperator(java.util.function.UnaryOperator) ClientTransport(io.scalecube.services.transport.api.ClientTransport) DefaultErrorMapper(io.scalecube.services.exceptions.DefaultErrorMapper) InetAddress(java.net.InetAddress) Map(java.util.Map) ServiceTransport(io.scalecube.services.transport.api.ServiceTransport) Disposables(reactor.core.Disposables) Address(io.scalecube.net.Address) GatewayOptions(io.scalecube.services.gateway.GatewayOptions) ServiceDiscoveryContext(io.scalecube.services.discovery.api.ServiceDiscoveryContext) ServerTransport(io.scalecube.services.transport.api.ServerTransport) ServiceRegistry(io.scalecube.services.registry.api.ServiceRegistry) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) UUID(java.util.UUID) ObjectName(javax.management.ObjectName) Collectors(java.util.stream.Collectors) ServiceDiscovery(io.scalecube.services.discovery.api.ServiceDiscovery) RoundRobinServiceRouter(io.scalecube.services.routing.RoundRobinServiceRouter) Objects(java.util.Objects) Routers(io.scalecube.services.routing.Routers) List(java.util.List) DataCodec(io.scalecube.services.transport.api.DataCodec) ServiceMethodInvoker(io.scalecube.services.methods.ServiceMethodInvoker) ServiceDiscoveryFactory(io.scalecube.services.discovery.api.ServiceDiscoveryFactory) Optional(java.util.Optional) ServiceMessage(io.scalecube.services.api.ServiceMessage) Exceptions(reactor.core.Exceptions) StandardMBean(javax.management.StandardMBean) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Disposable(reactor.core.Disposable) ServiceMethodRegistryImpl(io.scalecube.services.methods.ServiceMethodRegistryImpl) MethodInfo(io.scalecube.services.methods.MethodInfo) HashMap(java.util.HashMap) Scheduler(reactor.core.scheduler.Scheduler) Function(java.util.function.Function) Supplier(java.util.function.Supplier) Authenticator(io.scalecube.services.auth.Authenticator) ArrayList(java.util.ArrayList) ServiceMessageDataDecoder(io.scalecube.services.transport.api.ServiceMessageDataDecoder) MBeanServer(javax.management.MBeanServer) ServiceDiscoveryEvent(io.scalecube.services.discovery.api.ServiceDiscoveryEvent) ServiceRegistryImpl(io.scalecube.services.registry.ServiceRegistryImpl) Schedulers(reactor.core.scheduler.Schedulers) ManagementFactory(java.lang.management.ManagementFactory) NoSuchElementException(java.util.NoSuchElementException) Logger(org.slf4j.Logger) RETRY_NON_SERIALIZED(io.scalecube.reactor.RetryNonSerializedEmitFailureHandler.RETRY_NON_SERIALIZED) Mono(reactor.core.publisher.Mono) UnknownHostException(java.net.UnknownHostException) PrincipalMapper(io.scalecube.services.auth.PrincipalMapper) Flux(reactor.core.publisher.Flux) Gateway(io.scalecube.services.gateway.Gateway) StringJoiner(java.util.StringJoiner) Type(io.scalecube.services.discovery.api.ServiceDiscoveryEvent.Type) Collections(java.util.Collections) ServiceMethodRegistry(io.scalecube.services.methods.ServiceMethodRegistry) InetAddress(java.net.InetAddress) Address(io.scalecube.net.Address) Scheduler(reactor.core.scheduler.Scheduler) ServiceDiscoveryOptions(io.scalecube.services.discovery.api.ServiceDiscoveryOptions) List(java.util.List) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) GatewayOptions(io.scalecube.services.gateway.GatewayOptions)

Example 5 with Address

use of io.scalecube.net.Address in project scalecube by scalecube.

the class RSocketClientTransport method create.

@Override
public ClientChannel create(ServiceReference serviceReference) {
    // keep reference for threadsafety
    final Map<Address, Mono<RSocket>> monoMap = rsockets.get();
    final Address address = serviceReference.address();
    Mono<RSocket> mono = monoMap.computeIfAbsent(address, key -> getCredentials(serviceReference).flatMap(creds -> connect(key, creds, monoMap)).cache().doOnError(ex -> monoMap.remove(key)));
    return new RSocketClientChannel(mono, new ServiceMessageCodec(headersCodec, dataCodecs));
}
Also used : ByteBufAllocator(io.netty.buffer.ByteBufAllocator) ReferenceCountUtil(io.scalecube.services.transport.api.ReferenceCountUtil) LoggerFactory(org.slf4j.LoggerFactory) PayloadDecoder(io.rsocket.frame.decoder.PayloadDecoder) ClientTransport(io.scalecube.services.transport.api.ClientTransport) MessageCodecException(io.scalecube.services.exceptions.MessageCodecException) ByteBuf(io.netty.buffer.ByteBuf) RSocket(io.rsocket.RSocket) Map(java.util.Map) ByteBufPayload(io.rsocket.util.ByteBufPayload) UnauthorizedException(io.scalecube.services.exceptions.UnauthorizedException) Address(io.scalecube.net.Address) ServiceReference(io.scalecube.services.ServiceReference) ServiceException(io.scalecube.services.exceptions.ServiceException) Logger(org.slf4j.Logger) MaskUtil(io.scalecube.utils.MaskUtil) RSocketConnector(io.rsocket.core.RSocketConnector) Collection(java.util.Collection) ClientChannel(io.scalecube.services.transport.api.ClientChannel) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Mono(reactor.core.publisher.Mono) ByteBufOutputStream(io.netty.buffer.ByteBufOutputStream) Payload(io.rsocket.Payload) CredentialsSupplier(io.scalecube.services.auth.CredentialsSupplier) ServiceMessageCodec(io.scalecube.services.transport.api.ServiceMessageCodec) DataCodec(io.scalecube.services.transport.api.DataCodec) Collections(java.util.Collections) HeadersCodec(io.scalecube.services.transport.api.HeadersCodec) Address(io.scalecube.net.Address) Mono(reactor.core.publisher.Mono) RSocket(io.rsocket.RSocket) ServiceMessageCodec(io.scalecube.services.transport.api.ServiceMessageCodec)

Aggregations

Address (io.scalecube.net.Address)21 ScalecubeServiceDiscovery (io.scalecube.services.discovery.ScalecubeServiceDiscovery)17 WebsocketTransportFactory (io.scalecube.transport.netty.websocket.WebsocketTransportFactory)17 Mono (reactor.core.publisher.Mono)17 RSocketServiceTransport (io.scalecube.services.transport.rsocket.RSocketServiceTransport)15 Microservices (io.scalecube.services.Microservices)12 ServiceMessage (io.scalecube.services.api.ServiceMessage)7 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)7 ServiceDiscoveryEvent (io.scalecube.services.discovery.api.ServiceDiscoveryEvent)6 List (java.util.List)6 ServiceDiscoveryFactory (io.scalecube.services.discovery.api.ServiceDiscoveryFactory)5 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)5 Sinks (reactor.core.publisher.Sinks)5 Duration (java.time.Duration)4 Collections (java.util.Collections)4 Map (java.util.Map)4 Optional (java.util.Optional)4 Flux (reactor.core.publisher.Flux)4 ServiceCall (io.scalecube.services.ServiceCall)3 ServiceInfo (io.scalecube.services.ServiceInfo)3