-
Notifications
You must be signed in to change notification settings - Fork 0
/
default-config.js
33 lines (28 loc) · 1.18 KB
/
default-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module.exports = {
// Required, uses the same interfaces which is exposed by `console`
logger: undefined,
// RabbitMq connection configuration
rabbitMq: {
uri: '',
exchangeName: '',
exchangeType: 'topic',
routingKey: '#',
messageDeserializer: async message => JSON.parse(message.content.toString())
},
listener: {
// Amount of time the Schnorchel should be listening to the exchange.
// You can use human readable time values like 30sec, 5min, 1h etc
timeout: '5min',
// Amount of samples to store for each different schema
numberOfSamplesPerSchema: 20,
// Method to determine the name of the schema. Must return a string
// If return value is falsy, the message will be skipped
schemaNameFormatter: (deserializedMessage, routingKey) => { throw new Error('Please implement the schemaNameFormatter method') }
},
output: {
// The directory to output the generated schema files. This is relative to the working directory
directory: './output',
schemaSerializer: async schema => JSON.stringify(schema, null, 2),
schemaFileNameFormatter: (schemaName, config) => `${config.rabbitMq.exchangeName}-${schemaName}.json`
}
}