Interface ProcessorWrapper
- All Superinterfaces:
Configurable
Wrapper class that can be used to inject custom wrappers around the processors of their application topology.
The returned instance should wrap the supplied
ProcessorSupplier
and the Processor
it supplies
to avoid disrupting the regular processing of the application, although this is not required and any processor
implementation can be substituted in to replace the original processor entirely (which may be useful for example
while testing or debugging an application topology).
NOTE: in order to use this feature, you must set the StreamsConfig.PROCESSOR_WRAPPER_CLASS_CONFIG
config and pass it
in as a TopologyConfig
when creating the StreamsBuilder
or Topology
by using the
appropriate constructor (ie StreamsBuilder(TopologyConfig)
or Topology(TopologyConfig)
)
Can be configured, if desired, by implementing the configure(Map)
method. This will be invoked when
the ProcessorWrapper
is instantiated, and will provide it with the TopologyConfigs that were passed in
to the StreamsBuilder
or Topology
constructor.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <KIn,
VIn, KOut, VOut>
WrappedProcessorSupplier<KIn, VIn, KOut, VOut> asWrapped
(ProcessorSupplier<KIn, VIn, KOut, VOut> processorSupplier) Use to convert aProcessorSupplier
instance into aWrappedProcessorSupplier
static <KIn,
VIn, VOut>
WrappedFixedKeyProcessorSupplier<KIn, VIn, VOut> asWrappedFixedKey
(FixedKeyProcessorSupplier<KIn, VIn, VOut> processorSupplier) Use to convert aFixedKeyProcessorSupplier
instance into aWrappedFixedKeyProcessorSupplier
default void
Configure this class with the given key-value pairs<KIn,
VIn, VOut>
WrappedFixedKeyProcessorSupplier<KIn, VIn, VOut> wrapFixedKeyProcessorSupplier
(String processorName, FixedKeyProcessorSupplier<KIn, VIn, VOut> processorSupplier) Wrap or replace the providedFixedKeyProcessorSupplier
and return aWrappedFixedKeyProcessorSupplier
To convert aFixedKeyProcessorSupplier
instance into aWrappedFixedKeyProcessorSupplier
, use theasWrappedFixedKey(FixedKeyProcessorSupplier)
method<KIn,
VIn, KOut, VOut>
WrappedProcessorSupplier<KIn, VIn, KOut, VOut> wrapProcessorSupplier
(String processorName, ProcessorSupplier<KIn, VIn, KOut, VOut> processorSupplier) Wrap or replace the providedProcessorSupplier
and return aWrappedProcessorSupplier
To convert aProcessorSupplier
instance into aWrappedProcessorSupplier
, use theasWrapped(ProcessorSupplier)
method
-
Method Details
-
configure
Description copied from interface:Configurable
Configure this class with the given key-value pairs- Specified by:
configure
in interfaceConfigurable
-
wrapProcessorSupplier
<KIn,VIn, WrappedProcessorSupplier<KIn,KOut, VOut> VIn, wrapProcessorSupplierKOut, VOut> (String processorName, ProcessorSupplier<KIn, VIn, KOut, VOut> processorSupplier) Wrap or replace the providedProcessorSupplier
and return aWrappedProcessorSupplier
To convert aProcessorSupplier
instance into aWrappedProcessorSupplier
, use theasWrapped(ProcessorSupplier)
method -
wrapFixedKeyProcessorSupplier
<KIn,VIn, WrappedFixedKeyProcessorSupplier<KIn,VOut> VIn, wrapFixedKeyProcessorSupplierVOut> (String processorName, FixedKeyProcessorSupplier<KIn, VIn, VOut> processorSupplier) Wrap or replace the providedFixedKeyProcessorSupplier
and return aWrappedFixedKeyProcessorSupplier
To convert aFixedKeyProcessorSupplier
instance into aWrappedFixedKeyProcessorSupplier
, use theasWrappedFixedKey(FixedKeyProcessorSupplier)
method -
asWrapped
static <KIn,VIn, WrappedProcessorSupplier<KIn,KOut, VOut> VIn, asWrappedKOut, VOut> (ProcessorSupplier<KIn, VIn, KOut, VOut> processorSupplier) Use to convert aProcessorSupplier
instance into aWrappedProcessorSupplier
-
asWrappedFixedKey
static <KIn,VIn, WrappedFixedKeyProcessorSupplier<KIn,VOut> VIn, asWrappedFixedKeyVOut> (FixedKeyProcessorSupplier<KIn, VIn, VOut> processorSupplier) Use to convert aFixedKeyProcessorSupplier
instance into aWrappedFixedKeyProcessorSupplier
-