Class DebeziumMessageProducer

All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, SmartInitializingSingleton, ApplicationContextAware, Lifecycle, Phased, SmartLifecycle, ComponentSourceAware, ExpressionCapable, MessageProducer, IntegrationPattern, NamedComponent, IntegrationInboundManagement, IntegrationManagement, ManageableLifecycle, ManageableSmartLifecycle, TrackableComponent

public class DebeziumMessageProducer extends MessageProducerSupport
Debezium Change Event Channel Adapter.
Since:
6.2
Author:
Christian Tzolov, Artem Bilan
  • Constructor Details

    • DebeziumMessageProducer

      public DebeziumMessageProducer(io.debezium.engine.DebeziumEngine.Builder<io.debezium.engine.ChangeEvent<byte[],byte[]>> debeziumBuilder)
      Create new Debezium message producer inbound channel adapter.
      Parameters:
      debeziumBuilder - - pre-configured Debezium Engine Builder instance.
  • Method Details

    • setEnableBatch

      public void setEnableBatch(boolean enable)
      Enable the ChangeEvent batch mode handling. When enabled the channel adapter will send a List of ChangeEvents as a payload in a single downstream Message. Such a batch payload is not serializable. By default, the batch mode is disabled, e.g. every input ChangeEvent is converted into a single downstream Message.
      Parameters:
      enable - set to true to enable the batch mode. Disabled by default.
    • setEnableEmptyPayload

      public void setEnableEmptyPayload(boolean enabled)
      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 of Optional.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.
    • setTaskExecutor

      public void setTaskExecutor(TaskExecutor taskExecutor)
      Set a TaskExecutor for the Debezium engine task.
      Parameters:
      taskExecutor - the TaskExecutor to use.
    • setContentType

      public void setContentType(String contentType)
      Set the outbound message content type. Must be aligned with the SerializationFormat configuration used by the provided DebeziumEngine.
    • setHeaderMapper

      public void setHeaderMapper(HeaderMapper<List<io.debezium.engine.Header<Object>>> headerMapper)
      Set a HeaderMapper to convert the ChangeEvent headers into Message headers.
      Parameters:
      headerMapper - HeaderMapper implementation to use. Defaults to DefaultDebeziumHeaderMapper.
    • getComponentType

      public String getComponentType()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this method to provide component type information.
      Specified by:
      getComponentType in interface NamedComponent
      Overrides:
      getComponentType in class IntegrationObjectSupport
    • onInit

      protected void onInit()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this for initialization logic.
      Overrides:
      onInit in class MessageProducerSupport
    • doStart

      protected void doStart()
      Description copied from class: MessageProducerSupport
      Take no action by default. Subclasses may override this if they need lifecycle-managed behavior. Protected by 'lifecycleLock'.
      Overrides:
      doStart in class MessageProducerSupport
    • doStop

      protected void doStop()
      Description copied from class: MessageProducerSupport
      Take no action by default. Subclasses may override this if they need lifecycle-managed behavior.
      Overrides:
      doStop in class MessageProducerSupport