Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KafkaActorSubscriber log statement not displaying exception #21

Closed
gvd opened this issue Jul 18, 2015 · 6 comments
Closed

KafkaActorSubscriber log statement not displaying exception #21

gvd opened this issue Jul 18, 2015 · 6 comments

Comments

@gvd
Copy link

gvd commented Jul 18, 2015

In https://github.com/softwaremill/reactive-kafka/blob/master/src/main/scala/com/softwaremill/react/kafka/KafkaActorSubscriber.scala on line 36 I see:

log.error("Stopping subscriber due to an error", ex)

Which does not display the exception message

@kciesielski
Copy link
Contributor

Thanks, @gvd! Indeed, the logging interface is a bit unfortunate, I'm fixing this to
log.error(ex, "Stopping subscriber due to an error")
I'll try to add some test around it.

@adamw
Copy link
Contributor

adamw commented Jul 20, 2015

Maybe you could have an ExceptionHandler component, where the default handling would be to log the exceptions, but could provide hooks to e.g. restart the whole stream, try to reconnect, do exponential backoff etc?
Passed as an implicit or parameter with a default value?

@kciesielski
Copy link
Contributor

@adamw Underneath the subscriber is an Akka actor. Errors can be handled with custom behavior using DeathWatch. I'm checking how one can pass more details on exceptions with that.

@xelax
Copy link

xelax commented Jul 20, 2015

I might be wrong, but currently the underlying actor is not returned when building the stream, thus inhibiting the ability to supervise/register for deathwatch of that actor.

@kciesielski
Copy link
Contributor

There is some public API not mentioned in README. You can build your consumer like this:

val consumerActor = reactiveKafka.consumerAsActor[T](...)
val consumer = ActorPublisher[String](consumerActor)

and you have a working ActorRef which you can watch. I'm also trying to make it possible to supervise this actor, so that you can capture full exception when it crashes. Only then I'll fully close this issue.

@kciesielski kciesielski reopened this Jul 20, 2015
@kciesielski
Copy link
Contributor

Fixed fully in #23

@ennru ennru added this to the invalid milestone Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants