Interface ReplicationStream
- All Superinterfaces:
 Closeable
Postgresql replication stream. Once established, the stream occupies the 
PostgresqlReplicationConnection until this stream is closed. This stream can be consumed by
applying a mapping function using map(Function).- 
Method Summary
Modifier and TypeMethodDescriptionclose()Stop replication changes from server and free resources.Returns the last applied lsn send in update message to backed.Returns the last flushed lsn send in update message to backend.Returns the last received LSN position.booleanisClosed()<T> Flux<T> Returns a mapping of the replication stream which is an unbounded stream.voidsetAppliedLSN(LogSequenceNumber applied) Parameter used only physical replication and define which lsn already was apply on standby.voidsetFlushedLSN(LogSequenceNumber flushed) Sets the flushed LSN. 
- 
Method Details
- 
close
Stop replication changes from server and free resources. After that connection can be reused. Also after closing the current stream this object cannot be used anymore. Subscribers will see a completion signal if they are still subscribed. - 
isClosed
boolean isClosed()- Returns:
 trueif replication stream was already closed, otherwise returnfalse
 - 
map
Returns a mapping of the replication stream which is an unbounded stream.The
data bufferis released after applying themapping function.Unsubscribing from the stream will cancel consumption leaving protocol frames on the transport buffer.
Close theReplicationStreamobject to terminate the- Type Parameters:
 T- the type of the mapped value- Parameters:
 mappingFunction- theFunctionthat maps aByteBufto a value- Returns:
 - a mapping of the 
data buffersthat are the results of the replication stream - Throws:
 IllegalArgumentException- ifmappingFunctionisnull
 - 
getLastReceiveLSN
LogSequenceNumber getLastReceiveLSN()Returns the last received LSN position.- Returns:
 - LSN position that was received with the last read via 
map(Function) 
 - 
getLastFlushedLSN
LogSequenceNumber getLastFlushedLSN()Returns the last flushed lsn send in update message to backend.- Returns:
 - location of the last WAL flushed to disk in the standby
 
 - 
getLastAppliedLSN
LogSequenceNumber getLastAppliedLSN()Returns the last applied lsn send in update message to backed.- Returns:
 - location of the last WAL applied in the standby
 
 - 
setFlushedLSN
Sets the flushed LSN. The parameter will be send to backend on next update status iteration. Flushed LSN position help backend define which wal can be recycle.- Parameters:
 flushed- not null location of the last WAL flushed to disk in the standby
 - 
setAppliedLSN
Parameter used only physical replication and define which lsn already was apply on standby. Feedback will send to backend on next update status iteration.- Parameters:
 applied- not null location of the last WAL applied in the standby
 
 -