File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -332,8 +332,10 @@ func (session *Session) Close() error {
332
332
var err error
333
333
log .Debug (session .logger , "start shutdown of rabbit session" )
334
334
session .mu .Lock ()
335
- // block until we've nacked anyting in flight
336
- <- session .done
335
+ if ! session .config .PublishOnly {
336
+ // block until we've nacked anyting in flight..but not if we're only a Publisher!
337
+ <- session .done
338
+ }
337
339
338
340
// session.config.PublisherConnectionPool.ReturnChannel(session.publisherchannelhost, false)
339
341
session .config .ConsumerConnectionPool .ReturnChannel (session .consumerchannelhost , false )
Original file line number Diff line number Diff line change @@ -357,8 +357,11 @@ func (session *Session) Close() error {
357
357
var err error
358
358
log .Debug (session .logger , "start shutdown of rabbit session" )
359
359
session .mu .Lock ()
360
- // block until we've nacked anyting in flight
361
- <- session .done
360
+
361
+ if ! session .config .PublishOnly {
362
+ // block until we've nacked anyting in flight..but not if we're only a Publisher!
363
+ <- session .done
364
+ }
362
365
363
366
session .config .ConsumerConnectionPool .ReturnChannel (session .consumerchannelhost , false )
364
367
close (session .messages )
You can’t perform that action at this time.
0 commit comments