Class DebeziumMessageProducerSpec
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S,P>
org.springframework.integration.dsl.MessageProducerSpec<DebeziumMessageProducerSpec,DebeziumMessageProducer>
org.springframework.integration.debezium.dsl.DebeziumMessageProducerSpec
- All Implemented Interfaces:
DisposableBean
,FactoryBean<DebeziumMessageProducer>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
public class DebeziumMessageProducerSpec
extends MessageProducerSpec<DebeziumMessageProducerSpec,DebeziumMessageProducer>
- Since:
- 6.2
- Author:
- Christian Tzolov, Artem Bilan
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, target
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ModifierConstructorDescriptionprotected
DebeziumMessageProducerSpec
(io.debezium.engine.DebeziumEngine.Builder<io.debezium.engine.ChangeEvent<byte[], byte[]>> debeziumEngineBuilder) -
Method Summary
Modifier and TypeMethodDescriptioncontentType
(String contentType) Set the outbound message content type.enableBatch
(boolean enable) Enable theChangeEvent
batch mode handling.enableEmptyPayload
(boolean enabled) Enable support for tombstone (aka delete) messages.headerMapper
(HeaderMapper<List<io.debezium.engine.Header<Object>>> headerMapper) headerNames
(String... headerNames) Comma-separated list of names ofChangeEvent
headers to be mapped into outbound Message headers.taskExecutor
(TaskExecutor taskExecutor) Set aTaskExecutor
for the Debezium engine.Methods inherited from class org.springframework.integration.dsl.MessageProducerSpec
autoStartup, errorChannel, errorChannel, errorMessageStrategy, id, outputChannel, outputChannel, phase, sendTimeout, shouldTrack
Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, afterPropertiesSet, destroy, doGet, getId, getObject, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
Constructor Details
-
DebeziumMessageProducerSpec
protected DebeziumMessageProducerSpec(io.debezium.engine.DebeziumEngine.Builder<io.debezium.engine.ChangeEvent<byte[], byte[]>> debeziumEngineBuilder)
-
-
Method Details
-
enableBatch
Enable theChangeEvent
batch mode handling. When enabled the channel adapter will send aList
ofChangeEvent
s as a payload in a single downstreamMessage
. Such a batch payload is not serializable. By default, the batch mode is disabled, e.g. every inputChangeEvent
is converted into a single downstreamMessage
.- Parameters:
enable
- set to true to enable the batch mode. Disabled by default.- Returns:
- the spec.
-
enableEmptyPayload
Enable support for tombstone (aka delete) messages. On a database row delete, Debezium can send a tombstone change event that has the same key as the deleted row and a value ofOptional.empty()
. This record is a marker for downstream processors. It indicates that log compaction can remove all records that have this key. When the tombstone functionality is enabled in the Debezium connector configuration you should enable the empty payload as well.- Parameters:
enabled
- set true to enable the empty payload. Disabled by default.- Returns:
- the spec.
-
taskExecutor
Set aTaskExecutor
for the Debezium engine.- Parameters:
taskExecutor
- theTaskExecutor
to use.- Returns:
- the spec.
-
contentType
Set the outbound message content type. Must be aligned with theSerializationFormat
configuration used by the providedDebeziumEngine
.- Parameters:
contentType
- payload content type.- Returns:
- the spec.
-
headerNames
Comma-separated list of names ofChangeEvent
headers to be mapped into outbound Message headers. Debezium's NewRecordStateExtraction 'add.headers' property configures the metadata to be used asChangeEvent
headers.You should prefix the names passed to the 'headerNames' with the prefix configured by the Debezium 'add.headers.prefix' property. Later defaults to '__'. For example for 'add.headers=op,name' and 'add.headers.prefix=__' you should use header hames like: '__op', '__name'.
- Parameters:
headerNames
- The values in this list can be a simple patterns to be matched against the header names.- Returns:
- the spec.
-
headerMapper
public DebeziumMessageProducerSpec headerMapper(HeaderMapper<List<io.debezium.engine.Header<Object>>> headerMapper) - Parameters:
headerMapper
-HeaderMapper
implementation to use. Defaults toDefaultDebeziumHeaderMapper
.- Returns:
- the spec.
-