Package io.vertx.servicediscovery.types
Interface EventBusService
-
- All Superinterfaces:
ServiceType
public interface EventBusService extends ServiceType
ServiceType
for event bus services (service proxies). Consumers receive a service proxy to use the service.- Author:
- Clement Escoffier
-
-
Field Summary
Fields Modifier and Type Field Description static String
TYPE
Name of the type.-
Fields inherited from interface io.vertx.servicediscovery.spi.ServiceType
UNKNOWN
-
-
Method Summary
Static Methods Modifier and Type Method Description static Record
createRecord(String name, String address, Class itf)
Same ascreateRecord(String, String, Class, JsonObject)
but without metadata.static Record
createRecord(String name, String address, Class itf, JsonObject metadata)
Sugar method to creates a record for this type.static Record
createRecord(String name, String address, String classname)
Creates a record based on the parameters.static Record
createRecord(String name, String address, String itf, JsonObject metadata)
Sugar method to creates a record for this type.static <T> Future<T>
getProxy(ServiceDiscovery discovery, Class<T> itf)
Lookup for a service record and if found, retrieve it and return the service object (used to consume the service).static <T> Future<T>
getProxy(ServiceDiscovery discovery, Class<T> itf, JsonObject conf)
Lookup for a service record and if found, retrieve it and return the service object (used to consume the service).static <T> Future<T>
getServiceProxy(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, Class<T> clientClass)
Lookup for a service record and if found, retrieve it and return the service object (used to consume the service).static <T> Future<T>
getServiceProxy(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, Class<T> clientClass, JsonObject conf)
Lookup for a service record and if found, retrieve it and return the service object (used to consume the service).static <T> Future<T>
getServiceProxyWithJsonFilter(ServiceDiscovery discovery, JsonObject filter, Class<T> clientClass)
Lookup for a service record and if found, retrieve it and return the service object (used to consume the service).static <T> Future<T>
getServiceProxyWithJsonFilter(ServiceDiscovery discovery, JsonObject filter, Class<T> clientClass, JsonObject conf)
Lookup for a service record and if found, retrieve it and return the service object (used to consume the service).-
Methods inherited from interface io.vertx.servicediscovery.spi.ServiceType
get, name
-
-
-
-
Field Detail
-
TYPE
static final String TYPE
Name of the type.- See Also:
- Constant Field Values
-
-
Method Detail
-
createRecord
static Record createRecord(String name, String address, Class itf, JsonObject metadata)
Sugar method to creates a record for this type.The java interface is added to the metadata in the `service.interface` key.
- Parameters:
name
- the name of the service.address
- the event bus address on which the service availableitf
- the Java interfacemetadata
- the metadata- Returns:
- the created record
-
createRecord
static Record createRecord(String name, String address, String itf, JsonObject metadata)
Sugar method to creates a record for this type.The java interface is added to the metadata in the `service.interface` key.
- Parameters:
name
- the name of the service.address
- the event bus address on which the service availableitf
- the Java interface (name)metadata
- the metadata- Returns:
- the created record
-
createRecord
static Record createRecord(String name, String address, Class itf)
Same ascreateRecord(String, String, Class, JsonObject)
but without metadata.- Parameters:
name
- the name of the serviceitf
- the Java interfaceaddress
- the event bus address on which the service available- Returns:
- the created record
-
getProxy
static <T> Future<T> getProxy(ServiceDiscovery discovery, Class<T> itf)
Lookup for a service record and if found, retrieve it and return the service object (used to consume the service). This is a convenient method to avoid explicit lookup and then retrieval of the service. A filter based on the request interface is used.- Type Parameters:
T
- the service interface- Parameters:
discovery
- the service discovery instanceitf
- the service interface- Returns:
- a future notified with the client
-
getProxy
static <T> Future<T> getProxy(ServiceDiscovery discovery, Class<T> itf, JsonObject conf)
Lookup for a service record and if found, retrieve it and return the service object (used to consume the service). This is a convenient method to avoid explicit lookup and then retrieval of the service. A filter based on the request interface is used.- Type Parameters:
T
- the service interface- Parameters:
discovery
- the service discovery instanceitf
- the service interfaceconf
- the configuration for message delivery- Returns:
- a future notified with the client
-
getServiceProxy
static <T> Future<T> getServiceProxy(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, Class<T> clientClass)
Lookup for a service record and if found, retrieve it and return the service object (used to consume the service). This is a convenient method to avoid explicit lookup and then retrieval of the service. This method requires to have theclientClass
set with the expected set of client. This is important for usages not using Java so you can pass the expected type.- Type Parameters:
T
- the type of the client class- Parameters:
discovery
- the service discoveryfilter
- the filterclientClass
- the client class- Returns:
- a future notified with the client
-
getServiceProxy
static <T> Future<T> getServiceProxy(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, Class<T> clientClass, JsonObject conf)
Lookup for a service record and if found, retrieve it and return the service object (used to consume the service). This is a convenient method to avoid explicit lookup and then retrieval of the service. This method requires to have theclientClass
set with the expected set of client. This is important for usages not using Java so you can pass the expected type.- Type Parameters:
T
- the type of the client class- Parameters:
discovery
- the service discoveryfilter
- the filterclientClass
- the client classconf
- the configuration for message delivery- Returns:
- a future notified with the client
-
getServiceProxyWithJsonFilter
static <T> Future<T> getServiceProxyWithJsonFilter(ServiceDiscovery discovery, JsonObject filter, Class<T> clientClass)
Lookup for a service record and if found, retrieve it and return the service object (used to consume the service). This is a convenient method to avoid explicit lookup and then retrieval of the service. This method requires to have theclientClass
set with the expected set of client. This is important for usages not using Java so you can pass the expected type.- Type Parameters:
T
- the type of the client class- Parameters:
discovery
- the service discoveryfilter
- the filter as json objectclientClass
- the client class- Returns:
- a future notified with the client
-
getServiceProxyWithJsonFilter
static <T> Future<T> getServiceProxyWithJsonFilter(ServiceDiscovery discovery, JsonObject filter, Class<T> clientClass, JsonObject conf)
Lookup for a service record and if found, retrieve it and return the service object (used to consume the service). This is a convenient method to avoid explicit lookup and then retrieval of the service. This method requires to have theclientClass
set with the expected set of client. This is important for usages not using Java so you can pass the expected type.- Type Parameters:
T
- the type of the client class- Parameters:
discovery
- the service discoveryfilter
- the filter as json objectclientClass
- the client classconf
- the configuration for message delivery- Returns:
- a future notified with the client
-
-