Interface EventBusService
- All Superinterfaces:
ServiceType
ServiceType for event bus services (service proxies).
Consumers receive a service proxy to use the service.- Author:
- Clement Escoffier
-
Field Summary
FieldsFields inherited from interface ServiceType
UNKNOWN -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic RecordcreateRecord(String name, String address, Class itf) Same ascreateRecord(String, String, Class, JsonObject)but without metadata.static RecordcreateRecord(String name, String address, Class itf, JsonObject metadata) Sugar method to creates a record for this type.static RecordcreateRecord(String name, String address, String classname) Creates a record based on the parameters.static RecordcreateRecord(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, 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, 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 ServiceType
get, name
-
Field Details
-
TYPE
-
-
Method Details
-
createRecord
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
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
Same ascreateRecord(String, String, Class, JsonObject)but without metadata.- Parameters:
name- the name of the serviceaddress- the event bus address on which the service availableitf- the Java interface- Returns:
- the created record
-
getProxy
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
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, 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 theclientClassset 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, 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 theclientClassset 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 theclientClassset 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 theclientClassset 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
-
createRecord
-