Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Custom endpoint for SQS (VPC Endpoint) does not work. #2135
Please refer to aws/aws-sdk-ruby#2114 - this issue is the exact same as that one (for which a fix is being developed), but for Java.
QueueUrlHandler is the equivalent in Java that is causing SQS calls to not work when specifying a custom endpoint (such as an SQS VPC Endpoint). This is because, the custom endpoint is being replaced with the host in the queue URL, which happens to be
Hi @hhk1989, I just want to confirm the issue you're seeing with the SDK for Java, is the following code a good example of you're trying to do?
AmazonSQS sqsClient = AmazonSQSClientBuilder.standard() .withRegion(Regions.AP_SOUTH_1) .build(); SendMessageRequest sendMessageRequest = new SendMessageRequest() .withQueueUrl("https://vpce-<vpce-id>.sqs.us-west-2.vpce.amazonaws.com/<user-id>/<sqs-queue>") .withMessageBody("Hello"); SendMessageResult result = sqsClient.sendMessage(sendMessageRequest);
Could you share the stacktrace of the error?
@debora-ito apologies for the late response.
The code snippet we have would be something like the following (similar to the Ruby code in the linked issue above).
The issue is that the above makes a request to
The error we get in our applications in the DC is a 403, because the application has not whitelisted the above SQS public API path in our internal squid proxy that selectively allows only whitelisted public paths.
I understand it now. We may not be able to change this behavior, but a possible solution would be specifying the vpc endpoint url directly in the queue url as I did in my code example.
Anyway, we are investigating.