AWS SQS流未关闭

时间:2020-06-05 12:46:04

标签: amazon-web-services amazon-sqs akka-stream

在从AWS SQS空接收到消息时,我正在尝试使用以下代码关闭并停止监听,但没有发生-

val queueSourceSettings: SqsSourceSettings = SqsSourceSettings(
    getQueue(queueType).waitTimeSeconds,
    getQueue(queueType).maxBufferSize,
    getQueue(queueType).maxBatchSize,
    messageAttributeNames = Seq(
      MessageAttributeName(TRANSACTION_ID.name)
    ),
      closeOnEmptyReceive = true
  )
SqsSource(endpoint.queue.url, endpoint.client, endpoint.queueSourceSettings)
      .via(flow)
      .recoverWithRetries(-1, {
        case e =>
          logger.error("Stream Faiure: ", e)
          streamFailure(e)
          SqsSource(endpoint.queue.url, endpoint.client, endpoint.queueSourceSettings)
            .via(flow)
      })
      .runWith(SqsAckSink(endpoint.queue.url)(ec, endpoint.client))

0 个答案:

没有答案