Class PostgresAggregationRepository
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository
org.apache.camel.processor.aggregate.jdbc.PostgresAggregationRepository
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.AggregationRepository,org.apache.camel.spi.OptimisticLockingAggregationRepository,org.apache.camel.spi.RecoverableAggregationRepository,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
PostgreSQL specific
JdbcAggregationRepository that deals with SQL Violation Exceptions using special
INSERT INTO .. ON CONFLICT DO NOTHING clause.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.camel.spi.OptimisticLockingAggregationRepository
org.apache.camel.spi.OptimisticLockingAggregationRepository.OptimisticLockingException -
Field Summary
Fields inherited from class org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository
BODY, EXCHANGE, ID, jdbcCamelCodec, jdbcTemplate, transactionTemplate, transactionTemplateReadOnly, VERSION, VERSION_PROPERTYFields 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 -
Constructor Summary
ConstructorsConstructorDescriptionCreates an aggregation repositoryPostgresAggregationRepository(org.springframework.transaction.PlatformTransactionManager transactionManager, String repositoryName, DataSource dataSource) Creates an aggregation repository with the three mandatory parameters -
Method Summary
Methods inherited from class org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository
add, add, confirm, confirmWithResult, doInit, doStart, doStop, get, getDataSource, getDeadLetterUri, getDeserializationFilter, getHeadersToStoreAsText, getJdbcCamelCodec, getJdbcOptimisticLockingExceptionMapper, getKeys, getKeys, getLobHandler, getMaximumRedeliveries, getPropagationBehavior, getPropagationBehaviorName, getRecoveryInterval, getRepositoryName, getRepositoryNameCompleted, getTransactionManager, hasHeadersToStoreAsText, insertHelper, isAllowSerializedHeaders, isReturnOldExchange, isStoreBodyAsText, isUseRecovery, recover, remove, scan, setAllowSerializedHeaders, setDataSource, setDeadLetterUri, setDeserializationFilter, setHeadersToStoreAsText, setHeadersToStoreAsText, setJdbcCamelCodec, setJdbcOptimisticLockingExceptionMapper, setLobHandler, setMaximumRedeliveries, setPropagationBehavior, setPropagationBehaviorName, setRecoveryInterval, setRecoveryInterval, setRepositoryName, setReturnOldExchange, setStoreBodyAsText, setTransactionManager, setUseRecovery, update, updateHelperMethods 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, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.spi.RecoverableAggregationRepository
getRecoveryIntervalInMillisMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
PostgresAggregationRepository
public PostgresAggregationRepository()Creates an aggregation repository -
PostgresAggregationRepository
public PostgresAggregationRepository(org.springframework.transaction.PlatformTransactionManager transactionManager, String repositoryName, DataSource dataSource) Creates an aggregation repository with the three mandatory parameters
-
-
Method Details
-
insert
protected void insert(org.apache.camel.CamelContext camelContext, String correlationId, org.apache.camel.Exchange exchange, String repositoryName, Long version) throws Exception Inserts a new record into the given repository table- Overrides:
insertin classJdbcAggregationRepository- Parameters:
camelContext- the current CamelContextcorrelationId- the correlation keyexchange- the aggregated exchangerepositoryName- The name of the tableversion- Version identifier- Throws:
Exception
-