I am having problems getting Source.conflateWithSeed to work with
ActorSink.actorRefWithAck in akka-typed
val conflateBufferSize = 100
val conflateFlow =
Flow[Option[Message]]
.filter(_.nonEmpty)
.map(_.get)
.buffer(100, OverflowStrategy.backpressure)
.conflateWithSeed(seed = msg => Seq(msg))(aggregate = (accum, msg) => {
val a = accum :+ msg
println("Agg size= "+a.size)
a
})
.log("Conflated", _.size + " messages, buffer size="+conflateBufferSize)
case class StreamMsg(sender: ActorRef[Protocol], msg: Seq[Message]) extends
Protocol
val replyTo:ActorRef[Protocol] = ...
val actorSink = ActorSink.actorRefWithAck(
ref = replyTo,
onInitMessage = StreamInit,
messageAdapter = StreamMsg,
ackMessage = Ack,
onCompleteMessage = StreamComplete,
onFailureMessage = StreamFail
)
Then i pipe conflated source messages to the actor
messageSource
.via(conflateFlow)
.toMat(actorSink)(Keep.right)
.run()
No matter how much I slow down my actor sink ref object,
I keep getting only a single message in StreamMsg(_, msg = Seq(Message(_)) and
never the accumulated sequence in conflate
I can't get it to pass conflated buffer to the actor sink in the StreamMsg
Am I wiring component incorrectly? Any advice is greatly appreciated. Thank you
--
*****************************************************************************************************
** New discussion forum: https://discuss.akka.io/ replacing akka-user
google-group soon.
** This group will soon be put into read-only mode, and replaced by
discuss.akka.io
** More details: https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
*****************************************************************************************************
>>>>>>>>>>
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.