File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,8 @@ export declare interface Connection {
202202 on ( event : ConnectionEvents , listener : OnAmqpEvent ) : this;
203203}
204204
205+ const maxListenerLimit = 1000 ;
206+
205207/**
206208 * Describes the AMQP Connection.
207209 * @class Connection
@@ -256,6 +258,10 @@ export class Connection extends Entity {
256258 this . options . operationTimeoutInSeconds = options ?. operationTimeoutInSeconds ?? defaultOperationTimeoutInSeconds ;
257259
258260 this . _initializeEventListeners ( ) ;
261+
262+ // Set max listeners on the connection to 1000 because Session and Link add their own listeners
263+ // and the default value of 10 in NodeJS is too low.
264+ this . _connection . setMaxListeners ( maxListenerLimit ) ;
259265 }
260266
261267 /**
You can’t perform that action at this time.
0 commit comments