Top Description Methods
org.postgresql.replication.fluent

public Interface ChainedStreamBuilder

Known Direct Implementers
org.postgresql.replication.fluent.ReplicationStreamBuilder
Imports
org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder, org.postgresql.replication.fluent.physical.ChainedPhysicalStreamBuilder

Start point for fluent API that build replication stream(logical or physical). Api not thread safe, and can be use only for crate single stream.

Method Summary

Modifier and TypeMethod and Description
public ChainedLogicalStreamBuilder

Returns:

not null fluent api
logical
()

Create logical replication stream that decode raw wal logs by output plugin to logical form.

public ChainedPhysicalStreamBuilder

Returns:

not null fluent api
physical
()

Create physical replication stream for process wal logs in binary form.

Method Detail

logicalback to summary
public 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
   }

  
Returns:ChainedLogicalStreamBuilder

not null fluent api

physicalback to summary
public 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
   }

  
Returns:ChainedPhysicalStreamBuilder

not null fluent api