private ConnectionActor(final String connectionId, final ActorRef pubSubMediator, final ActorRef conciergeForwarder, final ClientActorPropsFactory propsFactory, @Nullable final Consumer<ConnectivityCommand<?>> customCommandValidator) { this.connectionId = connectionId; this.pubSubMediator = pubSubMediator; this.conciergeForwarder = conciergeForwarder; this.propsFactory = propsFactory; final DittoConnectivityCommandValidator dittoCommandValidator = new DittoConnectivityCommandValidator(propsFactory, conciergeForwarder, CONNECTION_VALIDATOR); if (customCommandValidator != null) { this.commandValidator = new CompoundConnectivityCommandInterceptor(dittoCommandValidator, customCommandValidator); } else { this.commandValidator = dittoCommandValidator; } final ConnectionConfigReader configReader = ConnectionConfigReader.fromRawConfig(getContext().system().settings().config()); snapshotThreshold = configReader.snapshotThreshold(); snapshotAdapter = new ConnectionMongoSnapshotAdapter(); connectionCreatedBehaviour = createConnectionCreatedBehaviour(); final java.time.Duration javaFlushTimeout = configReader.flushPendingResponsesTimeout(); flushPendingResponsesTimeout = Duration.create(javaFlushTimeout.toMillis(), TimeUnit.MILLISECONDS); }
private ConnectionActor(final String connectionId, final ActorRef pubSubMediator, final ActorRef conciergeForwarder, final ClientActorPropsFactory propsFactory, @Nullable final Consumer<ConnectivityCommand<?>> customCommandValidator) { this.connectionId = connectionId; this.pubSubMediator = pubSubMediator; this.conciergeForwarder = conciergeForwarder; this.propsFactory = propsFactory; final DittoConnectivityCommandValidator dittoCommandValidator = new DittoConnectivityCommandValidator(propsFactory, conciergeForwarder, CONNECTION_VALIDATOR); if (customCommandValidator != null) { this.commandValidator = new CompoundConnectivityCommandInterceptor(dittoCommandValidator, customCommandValidator); } else { this.commandValidator = dittoCommandValidator; } final ConnectionConfigReader configReader = ConnectionConfigReader.fromRawConfig(getContext().system().settings().config()); snapshotThreshold = configReader.snapshotThreshold(); snapshotAdapter = new ConnectionMongoSnapshotAdapter(); connectionCreatedBehaviour = createConnectionCreatedBehaviour(); final java.time.Duration javaFlushTimeout = configReader.flushPendingResponsesTimeout(); flushPendingResponsesTimeout = Duration.create(javaFlushTimeout.toMillis(), TimeUnit.MILLISECONDS); clientActorAskTimeout = configReader.clientActorAskTimeout(); LogUtil.enhanceLogWithCustomField(log, BaseClientData.MDC_CONNECTION_ID, connectionId); }