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
public class PostgresAggregationRepository extends JdbcAggregationRepository
PostgreSQL specificJdbcAggregationRepository
that deals with SQL Violation Exceptions using specialINSERT INTO .. ON CONFLICT DO NOTHING
claues.
-
-
Field Summary
-
Fields inherited from class org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository
allowSerializedHeaders, BODY, codec, EXCHANGE, ID, jdbcTemplate, transactionTemplate, transactionTemplateReadOnly, VERSION, VERSION_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description PostgresAggregationRepository()
Creates an aggregation repositoryPostgresAggregationRepository(org.springframework.transaction.PlatformTransactionManager transactionManager, String repositoryName, DataSource dataSource)
Creates an aggregation repository with the three mandatory parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
insert(org.apache.camel.CamelContext camelContext, String correlationId, org.apache.camel.Exchange exchange, String repositoryName, Long version)
Inserts a new record into the given repository table-
Methods inherited from class org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository
add, add, confirm, confirmWithResult, doInit, doStart, doStop, get, getDeadLetterUri, getHeadersToStoreAsText, getJdbcOptimisticLockingExceptionMapper, getKeys, getKeys, getLobHandler, getMaximumRedeliveries, getPropagationBehavior, getRecoveryIntervalInMillis, getRepositoryName, getRepositoryNameCompleted, hasHeadersToStoreAsText, insertHelper, isAllowSerializedHeaders, isReturnOldExchange, isStoreBodyAsText, isUseRecovery, recover, remove, scan, setAllowSerializedHeaders, setDataSource, setDeadLetterUri, setHeadersToStoreAsText, setJdbcCamelCodec, setJdbcOptimisticLockingExceptionMapper, setLobHandler, setMaximumRedeliveries, setPropagationBehavior, setPropagationBehaviorName, setRecoveryInterval, setRecoveryInterval, setRepositoryName, setReturnOldExchange, setStoreBodyAsText, setTransactionManager, setUseRecovery, update, updateHelper
-
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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
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 Detail
-
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:
insert
in classJdbcAggregationRepository
- Parameters:
camelContext
- the current CamelContextcorrelationId
- the correlation keyexchange
- the aggregated exchangerepositoryName
- The name of the tableversion
- Version identifier- Throws:
Exception
-
-