Untitled

mail@pastecode.io avatar
unknown
golang
11 days ago
417 B
1
Indexable
Never
// Configuration for RabbitMQ connection
cfg := rabbitmq.Config{
    ReconnectDelay: 5 * time.Second,  // Delay between reconnection attempts
    MaxReconnectAttempts: 10,         // Maximum number of reconnection attempts
    ReconnectDelayMultiplier: 2,      // Exponential backoff multiplier
}

// Create a new RabbitMQ connection
conn, err := rabbitmq.NewConn(
    "amqp://guest:guest@localhost:5672/",
    cfg,
)
Leave a Comment