我使用AWS java SDK为Glacier编写了一个备份/检索系统。它一直在工作,但程序现在无法检索,我得到以下异常:
状态代码:403,
AWS服务:AmazonSNS,
AWS Request ID:2cf43ec9-a5f5-51bd-b6b0-74c7bf725bac,
AWS错误代码:TopicLimitExceeded,
AWS错误消息:无法完成请求:超出主题配额
它似乎来自SNS,而不是Glacier。使用控制台,我可以看到SNS主题(12&)。尝试删除其中几个但似乎不起作用。有没有人见过这个?
try {
// Get the S3 directory file.
S3Object object = null;
try {
object = s3.getObject(new GetObjectRequest(s3BucketName, key));
} catch (com.amazonaws.AmazonClientException e) {
logger.error("Caught an AmazonClientException");
logger.error("Error Message: " + e.getMessage());
return;
}
// Show
logger.info("\tContent-Type: "
+ object.getObjectMetadata().getContentType());
GlacierS3Dir dir = GlacierS3Dir.digestS3GlacierDirectory(object
.getObjectContent());
logger.info("\tGlacier object ID is " + dir.getGlacierFileID());
// Connect to Glacier
ArchiveTransferManager atm = new ArchiveTransferManager(client,credentials);
logger.info("\tVault: " + vaultName);
// create a name
File f = new File(key);
String filename = f.getName();
filename = path + filename.replace("dir", "tgz");
logger.info("Downloading to '" + filename
+ "'. This will take up to 4 hours...");
atm.download(vaultName, dir.getGlacierFileID(), new File(filename));
logger.info("Done.");
} catch (AmazonServiceException ase) {
logger.error("Caught an AmazonServiceException.");
logger.error("Error Message: " + ase.getMessage());
logger.error("HTTP Status Code: " + ase.getStatusCode());
logger.error("AWS Error Code: " + ase.getErrorCode());
logger.error("Error Type: " + ase.getErrorType());
logger.error("Request ID: " + ase.getRequestId());
} catch (AmazonClientException ace) {
logger.error("Caught an AmazonClientException.");
logger.error("Error Message: " + ace.getMessage());
}
答案 0 :(得分:0)
更新:
我发现了这个问题。由于(懒惰)方式正在执行请求,因此正在为每个请求创建SNS主题。我刚刚达到了127个主题限制。删除(手动)主题和订阅可以解决问题。在我的特定情况下,将修改代码以使用一个SNS主题。谢谢! -