Interface MessageDecoder

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void close()
      Closes this decoder, freeing and/or closing all resources it may potentially hold.
      org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder optionsWithMetadata​(org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder builder)
      Allows MessageDecoder to configure options with which the replication stream is started.
      org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder optionsWithoutMetadata​(org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder builder)
      Allows MessageDecoder to configure options with which the replication stream is started.
      void processMessage​(ByteBuffer buffer, ReplicationStream.ReplicationMessageProcessor processor, TypeRegistry typeRegistry)
      Process a message upon arrival from logical decoder
      default void setContainsMetadata​(boolean flag)
      Signals to this decoder whether messages contain type metadata or not.
      boolean shouldMessageBeSkipped​(ByteBuffer buffer, Lsn lastReceivedLsn, Lsn startLsn, WalPositionLocator walPosition)
      A callback into the decoder allowing it to decide whether the supplied message should be processed by the decoder or whether it can be skipped.
    • Method Detail

      • optionsWithMetadata

        org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder optionsWithMetadata​(org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder builder)
        Allows MessageDecoder to configure options with which the replication stream is started. The messages CAN contain type metadata. See PostgreSQL command START_REPLICATION SLOT for more details.
        Parameters:
        builder -
        Returns:
        the builder instance
      • optionsWithoutMetadata

        org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder optionsWithoutMetadata​(org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder builder)
        Allows MessageDecoder to configure options with which the replication stream is started. The messages MUST NOT contain type metadata. See PostgreSQL command START_REPLICATION SLOT for more details.
        Parameters:
        builder -
        Returns:
        the builder instance
      • setContainsMetadata

        default void setContainsMetadata​(boolean flag)
        Signals to this decoder whether messages contain type metadata or not.
      • shouldMessageBeSkipped

        boolean shouldMessageBeSkipped​(ByteBuffer buffer,
                                       Lsn lastReceivedLsn,
                                       Lsn startLsn,
                                       WalPositionLocator walPosition)
        A callback into the decoder allowing it to decide whether the supplied message should be processed by the decoder or whether it can be skipped.
        Parameters:
        buffer - the replication stream buffer
        lastReceivedLsn - the last LSN reported by the replication stream
        startLsn - the starting LSN reported by the streaming producer
        walPosition - wal position from which the streaming should resume
        Returns:
        true if the incoming message should be skipped, false otherwise
      • close

        void close()
        Closes this decoder, freeing and/or closing all resources it may potentially hold.