Untitled

 avatar
unknown
golang
9 months ago
417 B
3
Indexable
// 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,
)
Editor is loading...
Leave a Comment