Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Public Interfaces

The following public config definition would be added to the TopologyConfig (NOTE: not StreamsConfig!!) class:the StreamsConfig  class. Note that the config itself will be defined in both the StreamsConfig and the TopologyConfig

Code Block
languagejava
titleProcessorWrapperStreamsConfig
public class TopologyConfigStreamsConfig {

    public static final String PROCESSOR_WRAPPER_CLASS_CONFIG = "processor.wrapper.class";
    private static final String PROCESSOR_WRAPPER_CLASS_DOC = "A processor wrapper class or class name that implements the <code>org.apache.kafka.streams.state.ProcessorWrapper</code> interface. Must be passed in to the StreamsBuilder or Topology constructor in order to take effect";
}


Code Block
languagejava
titleProcessorWrapper
/**
 * Wrapper class that can be used to inject custom wrappers around the processors of their application topology.
 * The returned instance MUST wrap the supplied {@code ProcessorSupplier} and the {@code Processor} it supplies.
 * Returning a new or completely different instance can have unexpected and undesirable affects.
 * <p>
 * Can be configured, if desired, by implementing the {@link #configure(Map)} method, which will be invoked
 * with the Streams application configs once the {@code ProcessorWrapper} is instantiated.
 */
public interface ProcessorWrapper extends Configurable {

    @Override
    default void configure(final Map<String, ?> configs) {
        // do nothing
    }

    <KIn, VIn, KOut, VOut> ProcessorSupplier<KIn, VIn, KOut, VOut> wrapProcessorSupplier(final String processorName,
                                                                                         final ProcessorSupplier<KIn, VIn, KOut, VOut> processorSupplier);

    <KIn, VIn,  VOut> FixedKeyProcessorSupplier<KIn, VIn,  VOut> wrapFixedKeyProcessorSupplier(final String processorName,
                                                                                               final FixedKeyProcessorSupplier<KIn, VIn, VOut> processorSupplier);
}

...