mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(sqs): accept bare queue name in QueueUrl field (#980)
AWS SQS resolves a plain queue name (e.g. "TestQueue") to the full queue URL transparently. Floci required the full URL, causing NonExistentQueue errors for clients that pass only the name - a pattern common in AWS SDK for Java v2 applications.
Add normalizeQueueUrl() which expands bare names to the canonical {baseUrl}/{accountId}/{queueName} form before storage-key computation, covering all SQS operations that accept a QueueUrl parameter.
This commit is contained in:
1 parent
be4eba1c20
commit
ff40a2fc0a
2 files changed
+47
-4
No files matched your search
@@ -829,4 +829,30 @@ class SqsServiceTest {
|
||||
verify(sns).clearFifoDeduplicationCacheForSqsQueueSubscriptions(
|
||||
queue.getQueueUrl(), "us-east-1");
|
||||
}
|
||||
|
||||
@Test
|
||||
void sendAndReceiveMessage_bareQueueName() {
|
||||
sqsService.createQueue("bare-name-queue", null);
|
||||
|
||||
Message sent = sqsService.sendMessage("bare-name-queue", "hello", 0);
|
||||
assertNotNull(sent.getMessageId());
|
||||
|
||||
List<Message> received = sqsService.receiveMessage("bare-name-queue", 1, 30, 0);
|
||||
assertEquals(1, received.size());
|
||||
assertEquals("hello", received.get(0).getBody());
|
||||
}
|
||||
|
||||
@Test
|
||||
void deleteQueue_bareQueueName() {
|
||||
sqsService.createQueue("delete-bare", null);
|
||||
assertDoesNotThrow(() -> sqsService.deleteQueue("delete-bare"));
|
||||
assertThrows(AwsException.class, () -> sqsService.deleteQueue("delete-bare"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getQueueAttributes_bareQueueName() {
|
||||
sqsService.createQueue("attrs-bare", Map.of("VisibilityTimeout", "45"));
|
||||
Map<String, String> attrs = sqsService.getQueueAttributes("attrs-bare", List.of("VisibilityTimeout"));
|
||||
assertEquals("45", attrs.get("VisibilityTimeout"));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user