通过扩展
extends GraphStage[SinkShape[MessageActionPair]]
您正在定义一个没有具体化价值的阶段。或者更好地定义一个具体化为
NotUsed
.
你必须决定你的舞台是否能变成任何有意义的东西。关于阶段物化值的更多信息
here
.
如果是的话
:您必须扩展
GraphStageWithMaterializedValue[SinkShape[MessageActionPair], Future[Done]]
并正确覆盖
createLogicAndMaterializedValue
作用有关更多指导,请参阅
docs
.
如果没有
:您可以根据以下内容更改类型
def withBackoff[T](minBackoff: FiniteDuration, maxBackoff: FiniteDuration, randomFactor: Double, sourcePool: Seq[SqsEndpoint]): Sink[MessageActionPair, NotUsed] = {
Sink.fromGraph(new RestartWithBackoffSink(sourcePool, minBackoff, maxBackoff, randomFactor))
}