Closed Zakharen closed 1 year ago
@Zakharen the delay means that the message you send can be received no sooner than 10 seconds later. See the test below as an example:
test("should create delayed queue") {
// Given
val queueUrl = client
.createQueue(new CreateQueueRequest("testQueue1").withAttributes(Map(delaySecondsAttribute -> "1").asJava))
.getQueueUrl
// When
client.sendMessage(new SendMessageRequest(queueUrl, "Message 1")).getMessageId
val m1 = receiveSingleMessage(queueUrl)
Thread.sleep(1100)
val m2 = receiveSingleMessage(queueUrl)
val m3 = receiveSingleMessage(queueUrl)
// Then
m1 should be(None)
m2 should be(Some("Message 1"))
m3 should be(None)
}
I'm using elasticmq image. Here is a part of my docker compose config:
here is elasticmq.conf with the following settings:
I was expecting to see a 10-second delay between each message I publish, but instead, I don't see any delay.