Skip to content

Commit

Permalink
re-enable enrichment of ThingDeleted events
Browse files Browse the repository at this point in the history
* to do that, also retrieve "policyId" in ThingEnforcerActor for already "marked as  deleted" things using the existing DittoHeader "DITTO_RETRIEVE_DELETED"

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
  • Loading branch information
thjaeckle committed Aug 10, 2022
1 parent ef44705 commit 37dd1e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -40,8 +40,8 @@
import org.eclipse.ditto.base.service.signaltransformer.SignalTransformer;
import org.eclipse.ditto.base.service.signaltransformer.SignalTransformers;
import org.eclipse.ditto.internal.utils.akka.actors.AbstractActorWithStashWithTimers;
import org.eclipse.ditto.internal.utils.akka.logging.DittoDiagnosticLoggingAdapter;
import org.eclipse.ditto.internal.utils.akka.logging.DittoLoggerFactory;
import org.eclipse.ditto.internal.utils.akka.logging.ThreadSafeDittoLoggingAdapter;
import org.eclipse.ditto.internal.utils.config.ScopedConfig;
import org.eclipse.ditto.internal.utils.metrics.DittoMetrics;
import org.eclipse.ditto.internal.utils.metrics.instruments.counter.Counter;
Expand Down Expand Up @@ -105,7 +105,7 @@ public abstract class AbstractPersistenceSupervisor<E extends EntityId, S extend

protected static final String PERSISTENCE_ACTOR_NAME = "pa";

protected final DittoDiagnosticLoggingAdapter log = DittoLoggerFactory.getDiagnosticLoggingAdapter(this);
protected final ThreadSafeDittoLoggingAdapter log = DittoLoggerFactory.getThreadSafeDittoLoggingAdapter(this);

private final SupervisorStrategy supervisorStrategy;

Expand Down
Expand Up @@ -25,6 +25,7 @@
import org.eclipse.ditto.base.model.exceptions.DittoInternalErrorException;
import org.eclipse.ditto.base.model.exceptions.DittoJsonException;
import org.eclipse.ditto.base.model.exceptions.DittoRuntimeException;
import org.eclipse.ditto.base.model.headers.DittoHeaderDefinition;
import org.eclipse.ditto.base.model.headers.DittoHeaders;
import org.eclipse.ditto.base.model.namespaces.NamespaceBlockedException;
import org.eclipse.ditto.base.model.signals.Signal;
Expand Down Expand Up @@ -397,6 +398,8 @@ protected CompletionStage<PolicyId> providePolicyIdForEnforcement(final Signal<?
JsonFieldSelector.newInstance("policyId"),
DittoHeaders.newBuilder()
.correlationId("sudoRetrieveThingFromThingEnforcerActor-" + UUID.randomUUID())
.putHeader(DittoHeaderDefinition.DITTO_RETRIEVE_DELETED.getKey(),
Boolean.TRUE.toString())
.build()
), DEFAULT_LOCAL_ASK_TIMEOUT
).thenApply(response -> extractPolicyIdFromSudoRetrieveThingResponse(response).orElse(null));
Expand Down

0 comments on commit 37dd1e5

Please sign in to comment.