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 specific JdbcAggregationRepository that deals with SQL Violation Exceptions using special INSERT INTO .. ON CONFLICT DO NOTHING claues.
  • 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:
      insert in class JdbcAggregationRepository
      Parameters:
      camelContext - the current CamelContext
      correlationId - the correlation key
      exchange - the aggregated exchange
      repositoryName - The name of the table
      version - Version identifier
      Throws:
      Exception