public interface MessageSource extends ServiceType
Modifier and Type | Field and Description |
---|---|
static String |
TYPE |
UNKNOWN
Modifier and Type | Method and Description |
---|---|
static Record |
createRecord(String name,
String address)
Same as
createRecord(String, String, Class, JsonObject) without additional metadata, and no type for
the payload. |
static Record |
createRecord(String name,
String address,
Class type)
Same as
createRecord(String, String, Class, JsonObject) without additional metadata. |
static Record |
createRecord(String name,
String address,
Class type,
JsonObject metadata)
Create a record representing a data producer.
|
static Record |
createRecord(String name,
String address,
String type)
Same as
createRecord(String, String, String, JsonObject) without additional metadata. |
static Record |
createRecord(String name,
String address,
String type,
JsonObject metadata)
Create a record representing a data producer.
|
static <T> Future<MessageConsumer<T>> |
getConsumer(ServiceDiscovery discovery,
java.util.function.Function<Record,Boolean> filter)
Like
getConsumer(ServiceDiscovery, Function, Handler) but returns a future of the result |
static <T> void |
getConsumer(ServiceDiscovery discovery,
java.util.function.Function<Record,Boolean> filter,
Handler<AsyncResult<MessageConsumer<T>>> resultHandler)
Convenient method that looks for a message source and provides the configured
MessageConsumer . |
static <T> Future<MessageConsumer<T>> |
getConsumer(ServiceDiscovery discovery,
JsonObject filter)
Like
getConsumer(ServiceDiscovery, JsonObject, Handler) but returns a future of the result |
static <T> void |
getConsumer(ServiceDiscovery discovery,
JsonObject filter,
Handler<AsyncResult<MessageConsumer<T>>> resultHandler)
Convenient method that looks for a message source and provides the configured
MessageConsumer . |
get, name
static final String TYPE
static Record createRecord(String name, String address, String type, JsonObject metadata)
name
- the name of the serviceaddress
- the address on which the data is senttype
- the type of payload (fully qualified name of the class)metadata
- additional metadatastatic Record createRecord(String name, String address, Class type, JsonObject metadata)
name
- the name of the serviceaddress
- the address on which the data is senttype
- the type of payloadmetadata
- additional metadatastatic Record createRecord(String name, String address, Class type)
createRecord(String, String, Class, JsonObject)
without additional metadata.name
- the name of the serviceaddress
- the address on which the data is senttype
- the type of payloadstatic Record createRecord(String name, String address, String type)
createRecord(String, String, String, JsonObject)
without additional metadata.name
- the name of the serviceaddress
- the address on which the data is senttype
- the type of payloadstatic Record createRecord(String name, String address)
createRecord(String, String, Class, JsonObject)
without additional metadata, and no type for
the payload.name
- the name of the serviceaddress
- the address on which the data is sent.static <T> void getConsumer(ServiceDiscovery discovery, JsonObject filter, Handler<AsyncResult<MessageConsumer<T>>> resultHandler)
MessageConsumer
. The
async result is marked as failed is there are no matching services, or if the lookup fails.T
- The class of the messagediscovery
- The service discovery instancefilter
- The filter, optionalresultHandler
- The result handlerstatic <T> Future<MessageConsumer<T>> getConsumer(ServiceDiscovery discovery, JsonObject filter)
getConsumer(ServiceDiscovery, JsonObject, Handler)
but returns a future of the resultstatic <T> void getConsumer(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, Handler<AsyncResult<MessageConsumer<T>>> resultHandler)
MessageConsumer
. The
async result is marked as failed is there are no matching services, or if the lookup fails.T
- The class of the messagediscovery
- The service discovery instancefilter
- The filter, must not be null
resultHandler
- The result handlerstatic <T> Future<MessageConsumer<T>> getConsumer(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter)
getConsumer(ServiceDiscovery, Function, Handler)
but returns a future of the resultCopyright © 2024 Eclipse. All rights reserved.