Skip to content
Permalink
Browse files

Log recovery of ThingPersistenceActor and shutdown due to purge.

Signed-off-by: Cai Yufei (INST/ECS1) <yufei.cai@bosch-si.com>
  • Loading branch information
yufei-cai committed Jun 12, 2019
1 parent 2f2241f commit 9455bd787d30c0abfb2dca0d54129fd08c726b30
@@ -20,6 +20,8 @@
import org.eclipse.ditto.signals.commands.common.Shutdown;
import org.eclipse.ditto.signals.commands.common.ShutdownReason;
import org.eclipse.ditto.signals.commands.common.ShutdownReasonType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import akka.actor.ActorRef;
import akka.actor.PoisonPill;
@@ -31,6 +33,8 @@
*/
public final class ShutdownNamespaceBehavior {

private static final Logger LOG = LoggerFactory.getLogger(ShutdownNamespaceBehavior.class);

private final String namespace;
private final ActorRef self;

@@ -79,6 +83,7 @@ private void shutdown(final Shutdown shutdown) {
final ShutdownReason shutdownReason = shutdown.getReason();
if (ShutdownReasonType.Known.PURGE_NAMESPACE.equals(shutdownReason.getType()) &&
Objects.equals(namespace, shutdownReason.getDetailsOrThrow())) {
LOG.info("Shutting down <{}> due to <{}>.", self, shutdown);
self.tell(PoisonPill.getInstance(), ActorRef.noSender());
}
}
@@ -275,7 +275,7 @@ public Receive createReceiveRecover() {
.match(RecoveryCompleted.class, rc -> {
if (thing != null) {
thing = enhanceThingWithLifecycle(thing);
log.debug("Thing <{}> was recovered.", thingId);
log.info("Thing <{}> was recovered.", thingId);

if (isThingActive()) {
becomeThingCreatedHandler();

0 comments on commit 9455bd7

Please sign in to comment.
You can’t perform that action at this time.