org.eclipse.ditto.connectivity.service.messaging.LegacyBaseConsumerActor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ditto-connectivity-service Show documentation
Show all versions of ditto-connectivity-service Show documentation
Eclipse Ditto is a framework for creating and managing digital twins in the IoT.
/*
* Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.ditto.connectivity.service.messaging;
import java.util.Objects;
import org.eclipse.ditto.base.model.exceptions.DittoRuntimeException;
import org.eclipse.ditto.connectivity.api.ExternalMessage;
import org.eclipse.ditto.connectivity.model.Connection;
import org.eclipse.ditto.connectivity.model.Source;
import org.eclipse.ditto.connectivity.service.config.ConnectivityConfig;
import org.eclipse.ditto.connectivity.service.util.ConnectivityMdcEntryKey;
import org.eclipse.ditto.internal.utils.akka.logging.DittoLoggerFactory;
import org.eclipse.ditto.internal.utils.akka.logging.ThreadSafeDittoLoggingAdapter;
import akka.stream.Materializer;
import akka.stream.OverflowStrategy;
import akka.stream.QueueOfferResult;
import akka.stream.javadsl.Sink;
import akka.stream.javadsl.SourceQueueWithComplete;
/**
* This class provides the previous default of telling messages to a mapping actor instead of using a stream
* with backpressure. The goal is to implement a stream based processing step by step for all ConsumerActors.
*
* @deprecated Extend {@link BaseConsumerActor} directly instead.
*/
@Deprecated
public abstract class LegacyBaseConsumerActor extends BaseConsumerActor {
protected final ThreadSafeDittoLoggingAdapter logger;
private final SourceQueueWithComplete messageMappingSourceQueue;
private final SourceQueueWithComplete dreSourceQueue;
protected LegacyBaseConsumerActor(final Connection connection,
final String sourceAddress,
final Sink