Function: getProducersAndConsumersForMessage()
getProducersAndConsumersForMessage(
directory): (id,version?,options?) =>Promise<{consumers:Service[];producers:Service[]; }>
Defined in: messages.ts:72
Returns the producers and consumers (services) for a given message.
Parameters
| Parameter | Type |
|---|---|
directory | string |
Returns
Function
Parameters
| Parameter | Type |
|---|---|
id | string |
version? | string |
options? | { latestOnly: boolean; } |
options.latestOnly? | boolean |
Returns
Promise<{ consumers: Service[]; producers: Service[]; }>
Example
import utils from '@eventcatalog/utils';
const { getProducersAndConsumersForMessage } = utils('/path/to/eventcatalog');
// Returns the producers and consumers (services) for a given message
const { producers, consumers } = await getProducersAndConsumersForMessage('InventoryAdjusted', '0.0.1');