diff --git a/lib/connection.js b/lib/connection.js index 381651b..53d852f 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -32,6 +32,7 @@ var tls = require('tls'); var EventEmitter = require('events').EventEmitter; var AMQP_PROTOCOL_ID = 0x00; +const MAX_LISTENER_LIMIT = 1000; function find_connect_config() { var paths; @@ -245,6 +246,7 @@ var Connection = function (options, container) { this.scheduled_reconnect = undefined; this.default_sender = undefined; this.closed_with_non_fatal_error = false; + this.setMaxListeners(MAX_LISTENER_LIMIT); var self = this; aliases.forEach(function (alias) { Object.defineProperty(self, alias, { get: remote_property_shortcut(alias) }); });