Specify SQS region

This commit is contained in:
Moxie Marlinspike 2018-10-25 04:03:01 -07:00
parent fedfc66403
commit ce5f73a5a6
2 changed files with 9 additions and 1 deletions

View File

@ -32,6 +32,10 @@ public class SqsConfiguration {
@JsonProperty
private String queueUrl;
@NotEmpty
@JsonProperty
private String region = "us-east-1";
public String getAccessKey() {
return accessKey;
}
@ -43,6 +47,10 @@ public class SqsConfiguration {
public String getQueueUrl() {
return queueUrl;
}
public String getRegion() {
return region;
}
}

View File

@ -54,7 +54,7 @@ public class DirectoryQueue {
final AWSStaticCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials);
this.queueUrl = sqsConfig.getQueueUrl();
this.sqs = AmazonSQSClientBuilder.standard().withCredentials(credentialsProvider).build();
this.sqs = AmazonSQSClientBuilder.standard().withRegion(sqsConfig.getRegion()).withCredentials(credentialsProvider).build();
}
public void addRegisteredUser(String user) {