I see that in docs that for SqsClient, the region
must be set in advance, making this client tied to a specific region only. my question is, is it possible to make SqsClient region agnostic, so, requests for different regions can be made using the same client. so, I'm thinking like specifying the region for each operation in queue Url. but when I checked GetQueueUrlRequest, it also doesnt have region
field. Is this by design? Is there no way to make SqsClient region agnostic?
Thanks
As specified in the AWS SDK Java V2 Dev Guide, when you create a Java V2 Service client object, you specify a region. Regions enable you to access AWS services that physically reside in a specific geographic area.
Regions are never specified using an AWS service opertion Request object. They are always specified using Service Clients. For example,
SqsClient sqs = SqsClient.builder()
.region(Region.US_WEST_2)
.credentialsProvider(ProfileCredentialsProvider.create())
.build();
That is simply how the Java V2 SDK works. You can read more about this topic in the AWS DEV guide here.