Skip to content

🐛 Fix: Add retry mechanism for RabbitMQ message publishing failures#3

Open
ChanYoungHan wants to merge 13 commits intoAlexiFeng:mainfrom
ChanYoungHan:bugfix/fail_to_publish_message
Open

🐛 Fix: Add retry mechanism for RabbitMQ message publishing failures#3
ChanYoungHan wants to merge 13 commits intoAlexiFeng:mainfrom
ChanYoungHan:bugfix/fail_to_publish_message

Conversation

@ChanYoungHan
Copy link

🐛 Fix: Add retry mechanism for RabbitMQ message publishing failures

Summary

Improve RabbitMQ connection reliability by implementing retry logic for failed message publishing due to network issues.

Changes

  • Retry Logic: Added 3-attempt retry mechanism for failed message publishing
  • Connection Timeout: Reduced default timeout values for faster failure detection
    • Connection timeout: 30s → 10s
    • Heartbeat: 600s → 300s
    • Blocked connection timeout: 300s → 60s
  • Connection Attempts: Increased from 3 to 5 attempts with reduced retry delay
  • TCP Options: Added TCP keepalive settings to resolve IPv6 connection issues
  • Error Handling: Enhanced error logging with retry attempt information

Benefits

  • ✅ Improved connection stability in unreliable network environments
  • ✅ Faster detection and recovery from connection failures
  • ✅ Better error visibility through enhanced logging
  • ✅ Reduced message publishing failures due to temporary network issues

Files Modified

  • utils/rabbitmq_publisher.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant