@Override
public Map<String, String> sendMessageBatch(CQSQueue queue, int shard, List<CQSMessage> messages) throws PersistenceException, IOException, InterruptedException, NoSuchAlgorithmException, JSONException {
if (queue == null) {
throw new PersistenceException(CQSErrorCodes.NonExistentQueue, "The supplied queue doesn't exist");
}
if (messages == null || messages.size() == 0) {
throw new PersistenceException(CQSErrorCodes.InvalidQueryParameter, "No messages are supplied.");
}
Map<CmbComposite, String> messageDataMap = new HashMap<CmbComposite, String>();
Map<String, String> ret = new HashMap<String, String>();
int ttl = queue.getMsgRetentionPeriod();
String key = Util.hashQueueUrl(queue.getRelativeUrl()) + "_" + shard + "_" + rand.nextInt(queue.getNumberOfPartitions());
for (CQSMessage message : messages) {
if (message == null) {
throw new PersistenceException(CQSErrorCodes.InvalidMessageContents, "The supplied message is invalid");
}
if (queue.isCompressed()) {
message.setBody(Util.compress(message.getBody()));
}