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

Getting [akka://my-app/user/cluster/rabbit-control/connection] null and unable to restore it #159

Open
afrancoc2000 opened this issue Sep 27, 2018 · 1 comment

Comments

@afrancoc2000
Copy link

Hi,

I've been working on an implementation of akka.cluster inside kubernetes using rabbit for some queues I need to use to consume and produce some messages. I found out, that I need to initialize the connection, like 30 seconds after the cluster is formed to get a healthy connection and if I don't wait all this time the connection is not established.

the only thing I get is a warning saying:

[akka://my-app/user/cluster/rabbit-control/connection] null

But I don't get any exceptions or errors that I can track.

I tried stablishing a supervision strategy from the actor that creates de rabbit control like this:

override val supervisorStrategy: OneForOneStrategy =
  OneForOneStrategy(maxNrOfRetries = -1, withinTimeRange = Duration.Inf) {
    case e: Exception =>
      val sw = new StringWriter
      e.printStackTrace(new PrintWriter(sw))
      LogHelper.logger.error(s"Ocurrió un error en un actor del Cluster: ${e.getMessage} \n stacktrace: ${sw.toString}")
      Restart
  }
...
context.actorOf(QueueService.getRabbitControlProps, "rabbit-control")

But, as no exception is thrown then the supervision strategy is never triggered.

I am thinking of creating like a health probe something that checks if messages are being produced and if it fails then restart the RabbitControl actor, but I was wondering if there is something in the library that could help me test this connection, or do you know what is the null in the error? and why isn't there like a nullpointerexception? or how could I scalate this warning to error?

Thanks.

@tilmanginzel
Copy link

@afrancoc2000 We use the StatusCheckMessage as a health check in our setup. You can see an example implementation here: #128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants