Class JdbcMessageIdRepository
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.processor.idempotent.jdbc.AbstractJdbcMessageIdRepository
org.apache.camel.processor.idempotent.jdbc.JdbcMessageIdRepository
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.IdempotentRepository,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
- Direct Known Subclasses:
JdbcCachedMessageIdRepository,JdbcOrphanLockAwareIdempotentRepository
@Metadata(label="bean",
description="Idempotent repository that uses a SQL database to store message ids.",
annotations="interfaceName=org.apache.camel.spi.IdempotentRepository")
@Configurer(metadataOnly=true)
public class JdbcMessageIdRepository
extends AbstractJdbcMessageIdRepository
Default implementation of
AbstractJdbcMessageIdRepository-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class org.apache.camel.processor.idempotent.jdbc.AbstractJdbcMessageIdRepository
dataSource, jdbcTemplate, log, processorName, transactionTemplateFields 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
ConstructorsConstructorDescriptionJdbcMessageIdRepository(DataSource dataSource, String processorName) JdbcMessageIdRepository(DataSource dataSource, org.springframework.transaction.support.TransactionTemplate transactionTemplate, String processorName) JdbcMessageIdRepository(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.transaction.support.TransactionTemplate transactionTemplate) -
Method Summary
Modifier and TypeMethodDescriptionprotected intdelete()Operations that deletes all the rowsprotected intOperations that deletes the key if it existsprotected voiddoInit()protected voiddoStart()protected intOperation that inserts the key if it does not already existbooleanprotected intqueryForInt(String key) Operation that returns the number of rows, if any, for the specified keyvoidsetClearString(String clearString) voidsetCreateString(String createString) voidsetCreateTableIfNotExists(boolean createTableIfNotExists) voidsetDeleteString(String deleteString) voidsetInsertString(String insertString) voidsetQueryString(String queryString) voidsetTableExistsString(String tableExistsString) voidsetTableName(String tableName) To use a custom table name instead of the default name: CAMEL_MESSAGEPROCESSEDMethods inherited from class org.apache.camel.processor.idempotent.jdbc.AbstractJdbcMessageIdRepository
add, clear, confirm, contains, createTransactionTemplate, doStop, getDataSource, getJdbcTemplate, getProcessorName, getTransactionTemplate, remove, setDataSource, setJdbcTemplate, setProcessorName, setTransactionTemplateMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getInternalLock, 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.IdempotentRepository
add, confirm, contains, removeMethods 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
-
Field Details
-
DEFAULT_TABLENAME
- See Also:
-
DEFAULT_TABLE_EXISTS_STRING
- See Also:
-
DEFAULT_CREATE_STRING
- See Also:
-
DEFAULT_QUERY_STRING
- See Also:
-
DEFAULT_INSERT_STRING
- See Also:
-
DEFAULT_DELETE_STRING
- See Also:
-
DEFAULT_CLEAR_STRING
- See Also:
-
-
Constructor Details
-
JdbcMessageIdRepository
public JdbcMessageIdRepository() -
JdbcMessageIdRepository
-
JdbcMessageIdRepository
public JdbcMessageIdRepository(DataSource dataSource, org.springframework.transaction.support.TransactionTemplate transactionTemplate, String processorName) -
JdbcMessageIdRepository
public JdbcMessageIdRepository(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.transaction.support.TransactionTemplate transactionTemplate)
-
-
Method Details
-
doInit
- Overrides:
doInitin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStart
- Overrides:
doStartin classAbstractJdbcMessageIdRepository- Throws:
Exception
-
queryForInt
Description copied from class:AbstractJdbcMessageIdRepositoryOperation that returns the number of rows, if any, for the specified key- Specified by:
queryForIntin classAbstractJdbcMessageIdRepository- Parameters:
key- the key- Returns:
- int number of rows
-
insert
Description copied from class:AbstractJdbcMessageIdRepositoryOperation that inserts the key if it does not already exist- Specified by:
insertin classAbstractJdbcMessageIdRepository- Parameters:
key- the key- Returns:
- int number of rows inserted
-
delete
Description copied from class:AbstractJdbcMessageIdRepositoryOperations that deletes the key if it exists- Specified by:
deletein classAbstractJdbcMessageIdRepository- Parameters:
key- the key- Returns:
- int number of rows deleted
-
delete
protected int delete()Description copied from class:AbstractJdbcMessageIdRepositoryOperations that deletes all the rows- Specified by:
deletein classAbstractJdbcMessageIdRepository- Returns:
- int number of rows deleted
-
isCreateTableIfNotExists
public boolean isCreateTableIfNotExists() -
setCreateTableIfNotExists
public void setCreateTableIfNotExists(boolean createTableIfNotExists) -
getTableExistsString
-
setTableExistsString
-
getTableName
-
setTableName
To use a custom table name instead of the default name: CAMEL_MESSAGEPROCESSED -
getCreateString
-
setCreateString
-
getQueryString
-
setQueryString
-
getInsertString
-
setInsertString
-
getDeleteString
-
setDeleteString
-
getClearString
-
setClearString
-