BackOff supervisor with reactive-kafka

30 views
Skip to first unread message

Kilic Ali-Firat

unread,
Dec 5, 2017, 8:45:10 AM12/5/17
to Akka User List
Hi Akka,

Something is unclear for me in code founded in reactive-kafka documentation. Below we are creating the supervisor using BackOff.onStop function. 

We are using the child props but we didn't create an actor using props. Do we need to create StreamWrapperActor with system.actorOf or the BackOffSupervisor will create the child ?

import akka.pattern.{Backoff, BackoffSupervisor}

val childProps = Props(classOf[StreamWrapperActor])

val supervisorProps = BackoffSupervisor.props(
  Backoff.onStop(
    childProps,
    childName = "streamActor",
    minBackoff = 3.seconds,
    maxBackoff = 30.seconds,
    randomFactor = 0.2
  )
)
val supervisor = system.actorOf(supervisorProps, name = "streamActorSupervisor")

Patrik Nordwall

unread,
Dec 5, 2017, 9:14:41 AM12/5/17
to akka...@googlegroups.com
The BackoffSupervisor will create the child StreamWrapperActor. You have to start the supervisorProps with actorOf.

It's probably easier to use the Streams restart stage

The reactive-kafka documentation should be updated to use that, and I think that was discussed in some ticket.

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



--

Patrik Nordwall
Akka Tech Lead
Lightbend -  Reactive apps on the JVM
Twitter: @patriknw

Kilic Ali-Firat

unread,
Dec 5, 2017, 9:21:08 AM12/5/17
to Akka User List
Hey Patrick, 

I will give a try to the Streams restart stage, in my use case, it seems more appropriate than wrapping streams in one actor. 
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.

To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Kilic Ali-Firat

unread,
Dec 7, 2017, 4:52:02 AM12/7/17
to Akka User List
Patrick, 

I'm using akka-streams 2.4.17 and it seems that RestartSource is not included in package akka.streams.scaladsl ?

Am I wrong ? 

Kilic Ali-Firat

unread,
Dec 7, 2017, 4:54:23 AM12/7/17
to Akka User List
Ok fouded in last version 2.5.7
Reply all
Reply to author
Forward
0 new messages