fox/rmq/config.go
2025-08-27 23:02:26 +08:00

28 lines
579 B
Go

package rmq
import (
"time"
)
type RabbitMQConfig struct {
URL string
ExchangeName string
QueueName string
RoutingKey string
ReconnectInterval time.Duration
MaxRetries int
PrefetchCount int
}
func LoadRabbitMQConfig() *RabbitMQConfig {
return &RabbitMQConfig{
URL: "amqp://guest:guest@localhost:5672/",
ExchangeName: "app_exchange",
QueueName: "app_queue",
RoutingKey: "app.routing.key",
ReconnectInterval: 5 * time.Second,
MaxRetries: 3,
PrefetchCount: 10,
}
}