Interface ReplicationConnection.Builder
- All Known Implementing Classes:
PostgresReplicationConnection.ReplicationConnectionBuilder
- Enclosing interface:
ReplicationConnection
public static interface ReplicationConnection.Builder
A builder for
ReplicationConnection-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a newReplicationConnectioninstancedropSlotOnClose(boolean dropSlotOnClose) Whether or not to drop the replication slot once the replication connection closesjdbcMetadataConnection(PostgresConnection jdbcConnection) Provides a JDBC connection used to query metadata, database information, ...statusUpdateInterval(Duration statusUpdateInterval) The number of milli-seconds the replication connection should periodically send updates to the server.streamParams(String streamParams) Optional parameters to pass to the logical decoder when the stream starts.Sets the instance for the PG logical decoding pluginwithPublication(String publicationName) Sets the publication name for the PG logical publicationwithPublicationAutocreateMode(PostgresConnectorConfig.AutoCreateMode publicationAutocreateMode) Sets the publication autocreate mode for the PG logical publicationwithSchema(PostgresSchema schema) Sets the schema instanceSets the name for the PG logical replication slotwithTableFilter(RelationalTableFilters tableFilter) Sets the publication tables to watch for the PG logical publicationwithTypeRegistry(TypeRegistry typeRegistry)
-
Field Details
-
DEFAULT_SLOT_NAME
Default replication settings- See Also:
-
DEFAULT_PUBLICATION_NAME
- See Also:
-
DEFAULT_DROP_SLOT_ON_CLOSE
static final boolean DEFAULT_DROP_SLOT_ON_CLOSE- See Also:
-
-
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
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:
-
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
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
-
withSchema
Sets the schema instance- Parameters:
schema- the schema, must not be null- Returns:
- this instance
-
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:
-
jdbcMetadataConnection
Provides a JDBC connection used to query metadata, database information, ...- Parameters:
jdbcConnection-- Returns:
-
build
ReplicationConnection build()Creates a newReplicationConnectioninstance- Returns:
- a connection, never null
-