Search in sources :

Example 1 with AutoOffsetReset

use of org.apache.kafka.streams.Topology.AutoOffsetReset in project kafka by apache.

the class StreamSourceNode method merge.

public void merge(final StreamSourceNode<?, ?> other) {
    final AutoOffsetReset resetPolicy = consumedInternal().offsetResetPolicy();
    final AutoOffsetReset otherResetPolicy = other.consumedInternal().offsetResetPolicy();
    if (resetPolicy != null && !resetPolicy.equals(otherResetPolicy) || otherResetPolicy != null && !otherResetPolicy.equals(resetPolicy)) {
        log.error("Tried to merge source nodes {} and {} which are subscribed to the same topic/pattern, but " + "the offset reset policies do not match", this, other);
        throw new TopologyException("Can't configure different offset reset policies on the same input topic(s)");
    }
    for (final GraphNode otherChild : other.children()) {
        other.removeChild(otherChild);
        addChild(otherChild);
    }
}
Also used : AutoOffsetReset(org.apache.kafka.streams.Topology.AutoOffsetReset) TopologyException(org.apache.kafka.streams.errors.TopologyException)

Aggregations

AutoOffsetReset (org.apache.kafka.streams.Topology.AutoOffsetReset)1 TopologyException (org.apache.kafka.streams.errors.TopologyException)1