Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions internal/msgqueue/rabbitmq/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func defaultMessageQueueImplOpts() *MessageQueueImplOpts {
disableTenantExchangePubs: false,
deadLetterBackoff: 5 * time.Second,
enableMessageRejection: false,
maxDeathCount: 5,
maxDeathCount: 1000,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too sure we want to change this default?

}
}

Expand Down Expand Up @@ -804,8 +804,14 @@ func (t *MessageQueueImpl) subscribe(
// message was rejected before
deathCount := xDeath[0].(amqp.Table)["count"].(int64)

logger := t.l.Warn()
if deathCount > int64(float64(t.maxDeathCount)*0.8) {
// only log as error if we've exceeded 80% of the max death count
logger = t.l.Error()
}
Comment thread
mnafees marked this conversation as resolved.

if deathCount > 5 {
t.l.Error().
logger.
Int64("death_count", deathCount).
Str("message_id", msg.ID).
Str("tenant_id", msg.TenantID.String()).
Expand Down
Loading