# Module: vertx-service-discovery-js/message_source

### Classes

MessageSource

### Methods

#### (static) MessageSource.createRecord(name, address, type, metadata) → {Object}

Create a record representing a data producer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name of the service
`address` | string | the address on which the data is sent
`type` | string | the type of payload (fully qualified name of the class)
`metadata` | Object | additional metadata

Source:
  - vertx-service-discovery-js/message_source.js, line 53

##### Returns:

the created record

Type
  Object

#### (static) MessageSource.getConsumer(discovery, filter, resultHandler)

Convenient method that looks for a message source and provides the configured . The async result is marked as failed is there are no matching services, or if the lookup fails.

##### Parameters:

Name | Type | Description
--- | --- | ---
`discovery` | ServiceDiscovery | The service discovery instance
`filter` | Object | The filter, optional
`resultHandler` | function | The result handler

Source:
  - vertx-service-discovery-js/message_source.js, line 73