io.vertx.servicediscovery.types

## Interface MessageSource

- All Superinterfaces:
    ServiceType

      public interface MessageSource
      extends ServiceType

  Service type for data producer. Providers are publishing data to a specific event bus address.
  Author:
    Clement Escoffier

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `TYPE`

    - ### Fields inherited from interface io.vertx.servicediscovery.spi.ServiceType

      `UNKNOWN`

  - ### Method Summary

    All Methods Static Methods Default Methods
    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`.

    - ### Methods inherited from interface io.vertx.servicediscovery.spi.ServiceType

      `get, name`

- - ### Field Detail

    - #### TYPE

          static final String TYPE

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### createRecord

          static Record createRecord(String name,
                                     String address,
                                     String type,
                                     JsonObject metadata)

      Create a record representing a data producer.
      Parameters:
        `name` - the name of the service
        `address` - the address on which the data is sent
        `type` - the type of payload (fully qualified name of the class)
        `metadata` - additional metadata
      Returns:
        the created record

    - #### createRecord

          static Record createRecord(String name,
                                     String address,
                                     Class type,
                                     JsonObject metadata)

      Create a record representing a data producer.
      Parameters:
        `name` - the name of the service
        `address` - the address on which the data is sent
        `type` - the type of payload
        `metadata` - additional metadata
      Returns:
        the created record

    - #### createRecord

          static Record createRecord(String name,
                                     String address,
                                     Class type)

      Same as `createRecord(String, String, Class, JsonObject)` without additional metadata.
      Parameters:
        `name` - the name of the service
        `address` - the address on which the data is sent
        `type` - the type of payload
      Returns:
        the created record

    - #### createRecord

          static Record createRecord(String name,
                                     String address,
                                     String type)

      Same as `createRecord(String, String, String, JsonObject)` without additional metadata.
      Parameters:
        `name` - the name of the service
        `address` - the address on which the data is sent
        `type` - the type of payload
      Returns:
        the created record

    - #### createRecord

          static Record createRecord(String name,
                                     String address)

      Same as `createRecord(String, String, Class, JsonObject)` without additional metadata, and no type for the payload.
      Parameters:
        `name` - the name of the service
        `address` - the address on which the data is sent.
      Returns:
        the created record

    - #### getConsumer

          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`. The async result is marked as failed is there are no matching services, or if the lookup fails.
      Type Parameters:
        `T` - The class of the message
      Parameters:
        `discovery` - The service discovery instance
        `filter` - The filter, optional
        `resultHandler` - The result handler

    - #### getConsumer

          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`. The async result is marked as failed is there are no matching services, or if the lookup fails.
      Type Parameters:
        `T` - The class of the message
      Parameters:
        `discovery` - The service discovery instance
        `filter` - The filter, must not be `null`
        `resultHandler` - The result handler

Copyright © 2017. All rights reserved.