File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class Binder
3838 # TODO: handle non-pubsub types
3939 id = bindingId from , to
4040 debug ' Binder.addBinding' , binding .type , id
41- return callback null if @bindings [id] or from == to
41+ return callback null if @bindings [id] # already exists, avoid duplicate
4242
4343 handler = (msg ) =>
4444 binding = @bindings [id]
@@ -50,8 +50,11 @@ class Binder
5050 for subCallback in subscription .handlers
5151 subCallback (subscription .binding , msg .data )
5252
53- @transport .sendTo ' outqueue' , to, msg .data , (err ) ->
54- throw err if err
53+ if from != to
54+ @transport .sendTo ' outqueue' , to, msg .data , (err ) ->
55+ throw err if err
56+ else
57+ # same topic/queue, data should appear without our forwarding
5558
5659 @transport .subscribeToQueue from , handler, (err ) =>
5760 return callback err if err
You can’t perform that action at this time.
0 commit comments