Skip to content

Commit 132ce71

Browse files
author
jmull3n
authored
Merge pull request #117 from pinpt/add-rabbitmqbits
Fix log messages, Change QoS
2 parents be266a3 + 7549149 commit 132ce71

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

rabbitmq/connectionpool.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ func (cp *ConnectionPool) GetConnection() (*ConnectionHost, error) {
105105
func (cp *ConnectionPool) ReturnConnection(connHost *ConnectionHost) {
106106
select {
107107
case cp.connections <- connHost:
108-
log.Debug(cp.logger, "closing connection")
108+
log.Debug(cp.logger, "returning connection")
109109
default:
110110
// pool is full, close passed connection
111+
log.Debug(cp.logger, "closing connection")
112+
111113
connHost.Connection.Close()
112114
}
113115
}

rabbitmq/rabbitmq.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func New(logger log.Logger, config Config) *Session {
8282

8383
// set a default QoS
8484
if config.Qos <= 0 {
85-
config.Qos = 3
85+
config.Qos = 1
8686
}
8787

8888
session := Session{
@@ -254,7 +254,7 @@ func (session *Session) startConsumeLoop(consumergroup string, autoAck bool, exc
254254

255255
err := session.consumerchannelhost.Channel.Cancel(
256256
consumergroup, // Consumer
257-
true, // No-Wait
257+
false, // No-Wait
258258
)
259259
if err != nil {
260260
log.Error(session.logger, "error closing channel on exit", "err", err)

0 commit comments

Comments
 (0)