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

public class ClusteredJdbcAggregationRepository extends JdbcAggregationRepository
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.
  • 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 interface org.apache.camel.spi.AggregationRepository
      Specified by:
      remove in interface org.apache.camel.spi.OptimisticLockingAggregationRepository
      Overrides:
      remove in class JdbcAggregationRepository
    • 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 CamelContext
      correlationId - Correlation key
      exchange - Aggregated exchange to insert
      repositoryName - Table's name
      version - 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

      public Set<String> scan(org.apache.camel.CamelContext camelContext)
      Specified by:
      scan in interface org.apache.camel.spi.RecoverableAggregationRepository
      Overrides:
      scan in class JdbcAggregationRepository
    • getInstanceId

      public String getInstanceId()
    • setInstanceId

      public void setInstanceId(String instanceId)
    • isRecoveryByInstance

      public boolean isRecoveryByInstance()
    • setRecoveryByInstance

      public void setRecoveryByInstance(boolean recoveryByInstance)