You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "llazanja (via GitHub)" <gi...@apache.org> on 2024/08/01 08:28:05 UTC

Re: [PR] SQS - Add delaySeconds to SQS batch publishing [pekko-connectors]

llazanja commented on code in PR #760:
URL: https://github.com/apache/pekko-connectors/pull/760#discussion_r1699650567


##########
sqs/src/test/scala/docs/scaladsl/SqsPublishSpec.scala:
##########
@@ -191,6 +198,30 @@ class SqsPublishSpec extends AnyFlatSpec with Matchers with DefaultTestContext w
     }
   }
 
+  it should "publish batch of SendMessageRequests with individual delays and pull them" taggedAs Integration in {
+    new IntegrationFixture {
+      // #batch-send-request
+      val messageDelaySeconds = 3
+      val messages = for (i <- 0 until 10)
+        yield
+          SendMessageRequest
+            .builder()
+            .messageBody(s"Message - $i")
+            .delaySeconds(messageDelaySeconds) // SQS queue should process messages after 5 seconds
+            .build()
+
+      val future = Source
+        .single(messages)
+        .runWith(SqsPublishSink.batchedMessageSink(queueUrl))
+      // #batch-send-request
+
+      future.futureValue shouldBe Done
+
+      receiveMessages(10) should have size 0 // delay hasn't elapsed
+      receiveMessages(10, messageDelaySeconds + 1) should have size 10 // delay has elapsed

Review Comment:
   @pjfanning are you concerned in general about this type of test which relies on time delays, or are you concerned about +1 specifically, in terms that it's too short?
   
   Cause I can tune it immediatelly



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org