Class PgReplicationSlotEndpoint
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.apache.camel.support.ScheduledPollEndpoint
-
- org.apache.camel.component.pg.replication.slot.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.
-
-
Constructor Summary
Constructors Constructor Description PgReplicationSlotEndpoint(String uri, org.apache.camel.Component component)
-
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 parametersvoid
setAutoCreateSlot(Boolean autoCreateSlot)
Auto create slot if it does not existvoid
setDatabase(String database)
PostgreSQL database namevoid
setHost(String host)
PostgreSQL server hostvoid
setOutputPlugin(String outputPlugin)
Output plugin name (e.g.void
setPassword(String password)
PostgreSQL passwordvoid
setPort(Integer port)
PostgreSQL server portvoid
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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
PgReplicationSlotEndpoint
public PgReplicationSlotEndpoint(String uri, org.apache.camel.Component component)
-
-
Method Detail
-
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
-
-