File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/core/infrastructure/events Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,11 @@ export abstract class Listener<T> implements ListenerContract {
1212 protected extraQueues : any = { } ;
1313 abstract exchange : string ;
1414 abstract topic : string ;
15+ protected exclusiveConnection : boolean = false ;
1516
17+ // FIXME: support exclusive connection per listener
1618 constructor ( ) {
17- this . connection = Connection . getConnection ( "listener" ) ;
19+ this . connection = Connection . getConnection ( this . connectionName ) ;
1820 }
1921
2022 init ( ) {
@@ -61,6 +63,10 @@ export abstract class Listener<T> implements ListenerContract {
6163 return queue . join ( '.' ) ;
6264 }
6365
66+ get connectionName ( ) : string {
67+ return this . exclusiveConnection ? this . constructor . name : 'listener' ;
68+ }
69+
6470 protected parseMessage ( msg : any ) {
6571 const json = msg . content . toString ( ) ;
6672 return JSON . parse ( json ) ;
You can’t perform that action at this time.
0 commit comments