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> 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> 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> 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 handlerCopyright © 2023 Eclipse. All rights reserved.