public interface ChainedStreamBuilder
Modifier and Type | Method and Description |
---|---|
ChainedLogicalStreamBuilder |
logical()
Create logical replication stream that decode raw wal logs by output plugin to logical form.
|
ChainedPhysicalStreamBuilder |
physical()
Create physical replication stream for process wal logs in binary form.
|
ChainedLogicalStreamBuilder logical()
Create logical replication stream that decode raw wal logs by output plugin to logical form. Default about logical decoding you can see by following link Logical Decoding Concepts .
Example usage:
PGReplicationStream stream =
pgConnection
.getReplicationAPI()
.replicationStream()
.logical()
.withSlotName("test_decoding")
.withSlotOption("include-xids", false)
.withSlotOption("skip-empty-xacts", true)
.start();
while (true) {
ByteBuffer buffer = stream.read();
//process logical changes
}
ChainedPhysicalStreamBuilder physical()
Create physical replication stream for process wal logs in binary form.
Example usage:
LogSequenceNumber lsn = getCurrentLSN();
PGReplicationStream stream =
pgConnection
.getReplicationAPI()
.replicationStream()
.physical()
.withStartPosition(lsn)
.start();
while (true) {
ByteBuffer buffer = stream.read();
//process binary WAL logs
}
Copyright © 1997-2020 PostgreSQL Global Development Group. All Rights Reserved.