Interface ReplicationConnection.Builder

All Known Implementing Classes:
PostgresReplicationConnection.ReplicationConnectionBuilder
Enclosing interface:
ReplicationConnection

public static interface ReplicationConnection.Builder
A builder for ReplicationConnection
  • Field Details

  • Method Details

    • withSlot

      Sets the name for the PG logical replication slot
      Parameters:
      slotName - the name of the slot, may not be null.
      Returns:
      this instance
      See Also:
    • withPublication

      ReplicationConnection.Builder withPublication(String publicationName)
      Sets the publication name for the PG logical publication
      Parameters:
      publicationName - the name of the publication, may not be null.
      Returns:
      this instance
      See Also:
    • withTableFilter

      Sets the publication tables to watch for the PG logical publication
      Parameters:
      tableFilter - the configured table filters
      Returns:
      this instance
    • withPublicationAutocreateMode

      ReplicationConnection.Builder withPublicationAutocreateMode(PostgresConnectorConfig.AutoCreateMode publicationAutocreateMode)
      Sets the publication autocreate mode for the PG logical publication
      Parameters:
      publicationAutocreateMode - the name of the publication, may not be null.
      Returns:
      this instance
    • withPlugin

      Sets the instance for the PG logical decoding plugin
      Parameters:
      pluginName - the name of the slot, may not be null.
      Returns:
      this instance
      See Also:
      • invalid reference
        #PROTOBUF_PLUGIN_NAME
    • dropSlotOnClose

      ReplicationConnection.Builder dropSlotOnClose(boolean dropSlotOnClose)
      Whether or not to drop the replication slot once the replication connection closes
      Parameters:
      dropSlotOnClose - true if the slot should be dropped once the connection is closed, false otherwise
      Returns:
      this instance
      See Also:
    • statusUpdateInterval

      ReplicationConnection.Builder statusUpdateInterval(Duration statusUpdateInterval)
      The number of milli-seconds the replication connection should periodically send updates to the server.
      Parameters:
      statusUpdateInterval - a duration; null or non-positive value causes Postgres' default to be applied
      Returns:
      this instance
    • withTypeRegistry

      ReplicationConnection.Builder withTypeRegistry(TypeRegistry typeRegistry)
    • withSchema

      Sets the schema instance
      Parameters:
      schema - the schema, must not be null
      Returns:
      this instance
    • streamParams

      ReplicationConnection.Builder streamParams(String streamParams)
      Optional parameters to pass to the logical decoder when the stream starts.
      Parameters:
      streamParams - String of key and value pairs declared with "=". Pairs are separated by ";". Example: "add-tables=public.table,public.table2;include-lsn=true"
      Returns:
      this instance
      See Also:
      • invalid reference
        #STREAM_PARAMS
    • jdbcMetadataConnection

      ReplicationConnection.Builder jdbcMetadataConnection(PostgresConnection jdbcConnection)
      Provides a JDBC connection used to query metadata, database information, ...
      Parameters:
      jdbcConnection -
      Returns:
    • build

      Creates a new ReplicationConnection instance
      Returns:
      a connection, never null