feat(queue-url): ExternalURLBase для публичного QueueUrl (+ env SHARED_SQS_EXTERNAL_URL_BASE), тест

This commit is contained in:
Repinoid
2026-10-10 13:44:22 +03:00
parent ee5503f9ac
commit f0e7cc905d
5 changed files with 50 additions and 0 deletions
+8
View File
@@ -67,6 +67,11 @@ func LoadYamlConfig(filename string, env string) []string {
models.CurrentEnvironment = envs[env]
// Публичный адрес очередей (напр. https://sqs.sinefo.ru) — override через env.
if v := os.Getenv("SHARED_SQS_EXTERNAL_URL_BASE"); v != "" {
models.CurrentEnvironment.ExternalURLBase = v
}
if envs[env].Port != "" {
ports = []string{envs[env].Port}
}
@@ -90,6 +95,9 @@ func LoadYamlConfig(filename string, env string) []string {
queueUrl = "http://" + models.CurrentEnvironment.Region + "." + models.CurrentEnvironment.Host + ":" +
models.CurrentEnvironment.Port + "/" + models.CurrentEnvironment.AccountID + "/" + queue.Name
}
if base := strings.TrimRight(models.CurrentEnvironment.ExternalURLBase, "/"); base != "" {
queueUrl = base + "/" + models.CurrentEnvironment.AccountID + "/" + queue.Name
}
queueArn := "arn:aws:sqs:" + models.CurrentEnvironment.Region + ":" + models.CurrentEnvironment.AccountID + ":" + queue.Name
if queue.ReceiveMessageWaitTimeSeconds == 0 {