This commit is contained in:
Adam Majer 2024-07-18 12:01:35 +02:00
parent 910d146441
commit eda764b192

View File

@ -61,6 +61,7 @@ func startProcessingObsMessages(host, username, password string) {
if len(username) > 0 && len(password) > 0 { if len(username) > 0 && len(password) > 0 {
auth = username + ":" + password + "@" auth = username + ":" + password + "@"
} }
connection, err := rabbitmq.DialTLS("amqps://"+auth+host, &tls.Config{ connection, err := rabbitmq.DialTLS("amqps://"+auth+host, &tls.Config{
ServerName: host, ServerName: host,
}) })
@ -74,7 +75,12 @@ func startProcessingObsMessages(host, username, password string) {
err = ch.ExchangeDeclarePassive("pubsub", "topic", true, false, false, false, nil) err = ch.ExchangeDeclarePassive("pubsub", "topic", true, false, false, false, nil)
failOnError(err, "Cannot find pubsub exchange") failOnError(err, "Cannot find pubsub exchange")
q, err := ch.QueueDeclare("", false, true, false, false, nil) q, err := ch.QueueDeclarePassive("obs-staging-bot", true, false, true, false, nil)
if err != nil {
log.Printf("queue not found .. trying to create it\n")
q, err = ch.QueueDeclare("obs-staging-bot", true, false, true, false, nil)
}
//q, err := ch.QueueDeclare("obs-staging-bot", false, true, false, false, nil)
failOnError(err, "Cannot declare queue") failOnError(err, "Cannot declare queue")
log.Printf("queue: %s:%d", q.Name, q.Consumers) log.Printf("queue: %s:%d", q.Name, q.Consumers)