feat(queue-url): ExternalURLBase для публичного QueueUrl (+ env SHARED_SQS_EXTERNAL_URL_BASE), тест
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -4,6 +4,7 @@ Local: # Environment name that can be passed on the
|
||||
Port: 4100 # port to listen on.
|
||||
Region: us-east-1
|
||||
AccountId: "100010001000"
|
||||
ExternalURLBase: "" # публичный адрес очередей (напр. https://sqs.sinefo.ru); пусто → http://{region}.{host}:{port}
|
||||
LogToFile: false # Log messages (true/false)
|
||||
LogFile: .st/goaws_messages.log # Log filename (for message logging
|
||||
EnableDuplicates: false # Enable or not deduplication based on messageDeduplicationId
|
||||
|
||||
Reference in New Issue
Block a user