-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsettings_MQ.js
More file actions
70 lines (64 loc) · 1.82 KB
/
settings_MQ.js
File metadata and controls
70 lines (64 loc) · 1.82 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* Created by Gang Lu on 6/12/16.
* E-mail: gang.lu.ict@gmail.com
*
* Copyright (c) 2016 bafst.com, All rights reserved.
*/
/*
* logger
* By default, winston use npm logging levels: { error: 0, warn: 1, info: 2, verbose: 3, debug: 4, silly: 5 }
*/
var winston = require('winston');
var logger = new (winston.Logger)({
transports: [
new (winston.transports.Console)({
json: false,
timestamp: true,
level: 'error'
}),
new winston.transports.File({
handleExceptions: true,
filename: __dirname + '/rmq.log',
json: false,
timestamp: true,
level: 'debug'
})
],
exceptionHandlers: [
new (winston.transports.Console)({
json: false,
timestamp: true
}),
new winston.transports.File({
filename: __dirname + '/exceptions.log',
json: false,
handleExceptions: true,
humanReadableUnhandledException: true
})
],
exitOnError: false
});
/*
* JAVA options
*/
var RMQClientJAR = '/home/deploy/rocketmq/alibaba-rocketmq/lib/';
var JAVA_EXT_DIRS = RMQClientJAR;
//JVM_OPTIONS = '-Xms32m -Xmx256m -mx256m -Xrs';
var JVM_OPTIONS = ['-Xms32m', '-Xmx256m', '-Xrs', '-Djava.ext.dirs=' + RMQClientJAR];
// the -Xrs flag will “reduce usage of operating-system signals by [the] Java virtual machine (JVM)”, to avoid issues when developing “applications that embed the JVM”
/*
* RocketMQ configurations
*/
var pullMaxNums = 32;
var MsgBodyEncoding = 'utf-8';
/*
* Export the options as the settings struct
*/
var settings = {
logger: logger,
JAVA_EXT_DIRS: JAVA_EXT_DIRS,
JVM_OPTIONS: JVM_OPTIONS,
pullMaxNums: pullMaxNums,
MsgBodyEncoding: MsgBodyEncoding
};
module.exports = settings;