package internal

import (
	"github.com/streadway/amqp"
	"log"
)

const NewRegistrationQueueName = "NewRegistrationQueue"
const RegistrationReplyQueueName = "RegistrationReplyQueue"
const CustomerNotificationQueueName = "CustomerNotificationQueue"

// Helper-Funktion für RabbitMQ-Verbindung
func FailOnError(err error, msg string) {
	if err != nil {
		log.Fatalf("%s: %s", msg, err)
	}
}

func ConnectToBroker() *amqp.Connection {
	conn, err := amqp.Dial("amqp://guest:guest@localhost:5672/")
	FailOnError(err, "Failed to connect to RabbitMQ")
	return conn
}
