LrSqsQueueAttributes.attributesAsStrings
Returns all of the attributes in the collection as string values.
public Map<String, String> attributesAsStrings()
Return values
This API returns a collection (Map) of queue attributes. Each attribute consists of a name (String object) and a value (String).
Example
public int action() throws Throwable {
LrSqsClient.initClient(region, fifoQueueUrl);
Map<String, String> initialQueueAttributes = LrSqsClient.getQueueAttributes(new ArrayList()
{{
add("ContentBasedDeduplication");
add("FifoThroughputLimit");
add("DeduplicationScope");
}}).attributesAsStrings();
Map<LrSqsQueueAttributeName, String> initialQueueAttributes_ = LrSqsClient.getQueueAttributes(new ArrayList()
{{
add("ContentBasedDeduplication");
add("FifoThroughputLimit");
add("DeduplicationScope");
}}).attributes();
boolean contentBasedDeduplication = initialQueueAttributes.get("ContentBasedDeduplication") == "true";
String fifoThroughputLimit = initialQueueAttributes.get("FifoThroughputLimit");
String deduplicationScope = initialQueueAttributes.get("DeduplicationScope");
HashMap<String, String> newAttributeValues = new HashMap()
{{
put("ContentBasedDeduplication", !contentBasedDeduplication ? "true" : "false");
put("FifoThroughputLimit", fifoThroughputLimit.equals("perQueue") ? "perMessageGroupId" : "perQueue");
put("DeduplicationScope", deduplicationScope.equals("messageGroup") ? "queue" : "messageGroup");
}};
LrSqsClient.setQueueAttributes(newAttributeValues);
LrSqsClient.setQueueAttributes(initialQueueAttributes);
LrSqsClient.closeClient();
return 0;
}