# 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 72

##### 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` | todo | The filter, must not be `null`
`resultHandler` | function | The result handler

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