Skip to content

io microsphere spring cloud client discovery ReactiveDiscoveryClientAdapter

github-actions[bot] edited this page Jun 10, 2026 · 6 revisions

ReactiveDiscoveryClientAdapter

Type: Class | Module: microsphere-spring-cloud-commons | Package: io.microsphere.spring.cloud.client.discovery | Since: 1.0.0

Source: microsphere-spring-cloud-commons/src/main/java/io/microsphere/spring/cloud/client/discovery/ReactiveDiscoveryClientAdapter.java

Overview

An adapter DiscoveryClient class based on ReactiveDiscoveryClient

Declaration

public class ReactiveDiscoveryClientAdapter implements DiscoveryClient

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.2.18-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Examples

Method Examples

description

ReactiveDiscoveryClient reactiveClient = new SimpleReactiveDiscoveryClient(properties);
DiscoveryClient adapter = new ReactiveDiscoveryClientAdapter(reactiveClient);
List<String> services = adapter.getServices();
String desc = adapter.description();

getInstances

List<ServiceInstance> instances = adapter.getInstances("test-service");

getServices

List<String> services = adapter.getServices();

probe

adapter.probe();

getOrder

int order = adapter.getOrder();

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-spring-cloud-commons</artifactId>
    <version>${microsphere-spring-cloud.version}</version>
</dependency>

Tip: Use the BOM (microsphere-spring-cloud-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.spring.cloud.client.discovery.ReactiveDiscoveryClientAdapter;

API Reference

Public Methods

Method Description
description Create a new ReactiveDiscoveryClientAdapter that wraps the given
getInstances Returns a blocking list of ServiceInstance objects for the given service ID
getServices Returns a blocking list of service names by collecting results from the
probe Delegates to the underlying ReactiveDiscoveryClient#probe() method to
getOrder Returns the order value from the underlying ReactiveDiscoveryClient.

Method Details

description

public String description()

Create a new ReactiveDiscoveryClientAdapter that wraps the given ReactiveDiscoveryClient as a blocking DiscoveryClient.

Example Usage:

`ReactiveDiscoveryClient reactiveClient = new SimpleReactiveDiscoveryClient(properties);
DiscoveryClient adapter = new ReactiveDiscoveryClientAdapter(reactiveClient);
List services = adapter.getServices();
`

getInstances

public List<ServiceInstance> getInstances(String serviceId)

Returns a blocking list of ServiceInstance objects for the given service ID by collecting results from the underlying ReactiveDiscoveryClient.

Example Usage:

`List instances = adapter.getInstances("test-service");
`

getServices

public List<String> getServices()

Returns a blocking list of service names by collecting results from the underlying ReactiveDiscoveryClient.

Example Usage:

`List services = adapter.getServices();
`

probe

public void probe()

Delegates to the underlying ReactiveDiscoveryClient#probe() method to verify the discovery client is operational.

Example Usage:

`adapter.probe();
`

getOrder

public int getOrder()

Returns the order value from the underlying ReactiveDiscoveryClient.

Example Usage:

`int order = adapter.getOrder();
`

See Also

  • DiscoveryClient

This documentation was auto-generated from the source code of microsphere-spring-cloud.

Home

spring-cloud-commons

spring-cloud-openfeign

Clone this wiki locally