Class ClusteredJdbcAggregationRepository
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.ClusteredJdbcAggregationRepository
- 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
- Direct Known Subclasses:
ClusteredPostgresAggregationRepository
JDBC based
AggregationRepository
JdbcAggregationRepository will only preserve any
Serializable compatible data types. If a data type is not such a type its dropped and a WARN is logged. And it only
persists the Message body and the Message headers. The Exchange properties are not persisted.-
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
allowSerializedHeaders, BODY, codec, EXCHANGE, ID, jdbcTemplate, transactionTemplate, transactionTemplateReadOnly, VERSION, VERSION_PROPERTY
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
-
Constructor Summary
ConstructorDescriptionCreates an aggregation repositoryClusteredJdbcAggregationRepository
(org.springframework.transaction.PlatformTransactionManager transactionManager, String repositoryName, DataSource dataSource) Creates an aggregation repository with the three mandatory parameters -
Method Summary
Modifier and TypeMethodDescriptionprotected void
insert
(org.apache.camel.CamelContext camelContext, String correlationId, org.apache.camel.Exchange exchange, String repositoryName, Long version, boolean completed) Inserts a new record into the given repository table.protected int
insertHelper
(org.apache.camel.CamelContext camelContext, String key, org.apache.camel.Exchange exchange, String sql, Long version, boolean completed) boolean
void
remove
(org.apache.camel.CamelContext camelContext, String correlationId, org.apache.camel.Exchange exchange) scan
(org.apache.camel.CamelContext camelContext) void
setInstanceId
(String instanceId) void
setRecoveryByInstance
(boolean recoveryByInstance) 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, insert, insertHelper, isAllowSerializedHeaders, isReturnOldExchange, isStoreBodyAsText, isUseRecovery, recover, 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
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 Details
-
ClusteredJdbcAggregationRepository
public ClusteredJdbcAggregationRepository()Creates an aggregation repository -
ClusteredJdbcAggregationRepository
public ClusteredJdbcAggregationRepository(org.springframework.transaction.PlatformTransactionManager transactionManager, String repositoryName, DataSource dataSource) Creates an aggregation repository with the three mandatory parameters
-
-
Method Details
-
remove
public void remove(org.apache.camel.CamelContext camelContext, String correlationId, org.apache.camel.Exchange exchange) - Specified by:
remove
in interfaceorg.apache.camel.spi.AggregationRepository
- Specified by:
remove
in interfaceorg.apache.camel.spi.OptimisticLockingAggregationRepository
- Overrides:
remove
in classJdbcAggregationRepository
-
insert
protected void insert(org.apache.camel.CamelContext camelContext, String correlationId, org.apache.camel.Exchange exchange, String repositoryName, Long version, boolean completed) throws Exception Inserts a new record into the given repository table. Note: the exchange properties are NOT persisted.- Parameters:
camelContext
- Current CamelContextcorrelationId
- Correlation keyexchange
- Aggregated exchange to insertrepositoryName
- Table's nameversion
- Version identifier- Throws:
Exception
-
insertHelper
protected int insertHelper(org.apache.camel.CamelContext camelContext, String key, org.apache.camel.Exchange exchange, String sql, Long version, boolean completed) throws Exception - Throws:
Exception
-
scan
- Specified by:
scan
in interfaceorg.apache.camel.spi.RecoverableAggregationRepository
- Overrides:
scan
in classJdbcAggregationRepository
-
getInstanceId
-
setInstanceId
-
isRecoveryByInstance
public boolean isRecoveryByInstance() -
setRecoveryByInstance
public void setRecoveryByInstance(boolean recoveryByInstance)
-