在从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))