Hello -

I have migrated to akka-streams 2.4.4 from 1.0. The following snippet of
code (part of a larger application) used to work properly in 1.0 but fails
in 2.4.4 ..

  def run(): Unit = {
    implicit val mat = ActorMaterializer()

    val summarizer = system.actorOf(Props[Summarizer])

    logger.info(s"Receiver: binding to $host:$port")

    Tcp().bind(host, port).runForeach { conn =>
      val receiveSink =
        conn.flow
            .via(Framing.delimiter(ByteString("\n"), maximumFrameLength =
4000, allowTruncation = true)).map(_.utf8String)
            .map(_.split(","))
            .mapConcat(Transaction(_).toList)

.to(Sink.fromSubscriber(ActorSubscriber[Transaction](summarizer)))

      Source.empty.to(receiveSink).run()  // ##
    }

    import system.dispatcher
    system.scheduler.schedule(0.seconds, 30.seconds, summarizer,
LogSummaryBalance)
  }

The problem is in the line marked // ##. When the client connects to this
service, I get different types of errors every time .. e.g. Broken Pipe,
Connection reset by peer etc. May be some race condition as the errors
differ every time.

Do I need to do anything different for the new version ?

Any help ?

Thanks.

-- 
Debasish Ghosh
http://manning.com/ghosh2
http://manning.com/ghosh

Twttr: @debasishg
Blog: http://debasishg.blogspot.com
Code: http://github.com/debasishg

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to