Class PgReplicationSlotEndpoint

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @UriEndpoint(firstVersion="3.0.0",
                 scheme="pg-replication-slot",
                 title="PostgresSQL Replication Slot",
                 syntax="pg-replication-slot:host:port/database/slot:outputPlugin",
                 category={DATABASE,SQL},
                 consumerOnly=true)
    public class PgReplicationSlotEndpoint
    extends org.apache.camel.support.ScheduledPollEndpoint
    Poll for PostgreSQL Write-Ahead Log (WAL) records using Streaming Replication Slots.
    • Field Summary

      • Fields inherited from class org.apache.camel.support.service.BaseService

        BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.camel.Consumer createConsumer​(org.apache.camel.Processor processor)  
      org.apache.camel.Producer createProducer()  
      Boolean getAutoCreateSlot()  
      String getDatabase()  
      String getHost()  
      String getOutputPlugin()  
      String getPassword()  
      Integer getPort()  
      String getSlot()  
      Map<String,​Object> getSlotOptions()  
      Integer getStatusInterval()  
      String getUser()  
      protected void parseUri​(String uri)
      Parse the provided URI and extract available parameters
      void setAutoCreateSlot​(Boolean autoCreateSlot)
      Auto create slot if it does not exist
      void setDatabase​(String database)
      PostgreSQL database name
      void setHost​(String host)
      PostgreSQL server host
      void setOutputPlugin​(String outputPlugin)
      Output plugin name (e.g.
      void setPassword​(String password)
      PostgreSQL password
      void setPort​(Integer port)
      PostgreSQL server port
      void setSlot​(String slot)
      Replication slot name.
      void setSlotOptions​(Map<String,​Object> slotOptions)
      Slot options to be passed to the output plugin.
      void setStatusInterval​(Integer statusInterval)
      Specifies the number of seconds between status packets sent back to Postgres server.
      void setUser​(String user)
      PostgreSQL username
      • Methods inherited from class org.apache.camel.support.ScheduledPollEndpoint

        configureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, doStart, doStop, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay
      • Methods inherited from class org.apache.camel.support.DefaultEndpoint

        configurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
      • Methods inherited from interface org.apache.camel.Endpoint

        getEndpointBaseUri, isSingletonProducer
      • Methods inherited from interface org.apache.camel.Service

        build, close, init, start, stop
      • Methods inherited from interface org.apache.camel.ShutdownableService

        shutdown
      • Methods inherited from interface org.apache.camel.StatefulService

        getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
      • Methods inherited from interface org.apache.camel.SuspendableService

        isSuspended, resume, suspend
    • Constructor Detail

      • PgReplicationSlotEndpoint

        public PgReplicationSlotEndpoint​(String uri,
                                         org.apache.camel.Component component)
    • Method Detail

      • createProducer

        public org.apache.camel.Producer createProducer()
                                                 throws Exception
        Throws:
        Exception
      • createConsumer

        public org.apache.camel.Consumer createConsumer​(org.apache.camel.Processor processor)
                                                 throws Exception
        Throws:
        Exception
      • parseUri

        protected final void parseUri​(String uri)
        Parse the provided URI and extract available parameters
        Throws:
        IllegalArgumentException - if there is an error in the parameters
      • getHost

        public String getHost()
      • setHost

        public void setHost​(String host)
        PostgreSQL server host
      • getPort

        public Integer getPort()
      • setPort

        public void setPort​(Integer port)
        PostgreSQL server port
      • getDatabase

        public String getDatabase()
      • setDatabase

        public void setDatabase​(String database)
        PostgreSQL database name
      • getSlot

        public String getSlot()
      • setSlot

        public void setSlot​(String slot)
        Replication slot name.
      • getOutputPlugin

        public String getOutputPlugin()
      • setOutputPlugin

        public void setOutputPlugin​(String outputPlugin)
        Output plugin name (e.g. test_decoding, wal2json)
      • getUser

        public String getUser()
      • setUser

        public void setUser​(String user)
        PostgreSQL username
      • getPassword

        public String getPassword()
      • setPassword

        public void setPassword​(String password)
        PostgreSQL password
      • getStatusInterval

        public Integer getStatusInterval()
      • setStatusInterval

        public void setStatusInterval​(Integer statusInterval)
        Specifies the number of seconds between status packets sent back to Postgres server.
      • setSlotOptions

        public void setSlotOptions​(Map<String,​Object> slotOptions)
        Slot options to be passed to the output plugin.
      • getAutoCreateSlot

        public Boolean getAutoCreateSlot()
      • setAutoCreateSlot

        public void setAutoCreateSlot​(Boolean autoCreateSlot)
        Auto create slot if it does not exist