infrastructure/signal-server-patches/remove-sqs.patch

34 lines
1.7 KiB
Diff
Raw Permalink Normal View History

2020-06-17 04:37:37 +00:00
diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java b/service/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java
index af8b89a..c4cad9d 100644
2019-10-17 04:28:31 +00:00
--- a/service/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java
+++ b/service/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java
2020-06-17 04:37:37 +00:00
@@ -67,27 +67,7 @@ public class DirectoryQueue {
}
2020-06-17 04:37:37 +00:00
private void sendMessage(String action, UUID uuid, String number) {
- final Map<String, MessageAttributeValue> messageAttributes = new HashMap<>();
2020-06-17 04:37:37 +00:00
- messageAttributes.put("id", new MessageAttributeValue().withDataType("String").withStringValue(number));
- messageAttributes.put("uuid", new MessageAttributeValue().withDataType("String").withStringValue(uuid.toString()));
- messageAttributes.put("action", new MessageAttributeValue().withDataType("String").withStringValue(action));
- SendMessageRequest sendMessageRequest = new SendMessageRequest()
- .withQueueUrl(queueUrl)
- .withMessageBody("-")
2020-06-17 04:37:37 +00:00
- .withMessageDeduplicationId(UUID.randomUUID().toString())
- .withMessageGroupId(number)
- .withMessageAttributes(messageAttributes);
- try {
- sqs.sendMessage(sendMessageRequest);
- } catch (AmazonServiceException ex) {
- serviceErrorMeter.mark();
- logger.warn("sqs service error: ", ex);
- } catch (AmazonClientException ex) {
- clientErrorMeter.mark();
- logger.warn("sqs client error: ", ex);
- } catch (Throwable t) {
- logger.warn("sqs unexpected error: ", t);
- }
2020-06-17 04:37:37 +00:00
+ logger.info("Pretending to send SQS message: " + action);
}
}